ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Example: Adding a file into a binary memo
  • Example: Adding an image to a memo
HLinkMemo (Example)
Example: Adding a file into a binary memo
WINDEVUser code (UMC)HFSQL ClassicHFSQL Client/ServerStored proceduresHyper File 5.5OLE DBNative Connectors (Native Accesses)
The following example is used to add any file into a "binary memo" item of a data file.
// Renseignement des différentes rubriques du fichier ...

// Un nom de fichier a été indiqué pour la description du produit ?
IF NOT SAI_NOM_FICHIER ~= "" THEN
	// Oui, on vérifie que ce fichier existe bien
	IF fFileExist(SAI_NOM_FICHIER) = False THEN
		Error("Impossible d'ajouter " + ...
			"le fichier de description du produit " + ...
			"dans la base : ", HErrorInfo())
		RETURN // ou RENVOYER Faux
	END

	// Ajout du fichier qui contient la description du produit 
	// dans la rubrique mémo binaire de l'enregistrement
	IF HLinkMemo(PRODUIT, DESCRIPTIONPRODUIT, SAI_NOM_FICHIER, ...
			hMemoBin, "Description du fichier") = False THEN
		Error("Impossible d'ajouter " + ...
			"le fichier de description du produit " + ...
			"dans la base : ", HErrorInfo())
		RETURN //ou RENVOYER Faux
	END
END

// Ajoute (ou modifie) le produit au fichier des produits
IF HAdd(PRODUIT) = False THEN // ou SI HModifie(PRODUIT) = Faux ALORS
	Error("Impossible de mettre à jour le fichier produit :", ...
			HErrorInfo())
	RETURN //ou RENVOYER Faux
END

RETURN True
Example: Adding an image to a memo
WINDEVUser code (UMC)HFSQL ClassicHFSQL Client/ServerStored proceduresHyper File 5.5OLE DBNative Connectors (Native Accesses)
The following example is a procedure used to add a product to the PRODUCT data file. This procedure is used to attach the image of each product in the memo of the record.
// Procédure d'ajout d'un produit
FUNCTION bAjouteProduit(sNomProduit, sImage)

// Nom du produit
PRODUIT.NOM = sNomProduit

// Photo du produit
IF HLinkMemo(PRODUIT,PHOTO, sImage, hMemoImg) = False THEN
	RETURN False
END

// Ajoute le produit au fichier des produits
IF HAdd(PRODUIT) = False THEN
	RETURN False
END

RETURN True
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help