ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

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
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)PHPAjaxHFSQL 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.
// Fill the different items of the file ...
 
// Was a file name specified for the description of the product?
IF NOT EDT_FILE_NAME ~= "" THEN
// Checks whether this file exists
IF fFileExist(EDT_FILE_NAME) = False THEN
Error("Cannot add " + ...
"the product description file " + ...
"to the database: ", HErrorInfo())
RETURN // or RESULT False
END
 
// Add the file that contains the product description
// in the binary memo item of the record
IF HLinkMemo(PRODUCT,PRODUCTDESCRIPTION, EDT_FILE_NAME, ...
hMemoBin,"File description") = False THEN
Error("Cannot add " + ...
"the product description file " + ...
"to the database: ", HErrorInfo())
RETURN //or RESULT False
END
END
 
// Adds (or modifies) the product to the file of products
IF HAdd(PRODUCT) = False THEN // or IF HModify(PRODUCT) = False THEN
Error("Unable to update the product file:", ...
HErrorInfo())
RETURN //or RESULT False
END
 
RETURN True
Example: Adding an image to a memo
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)PHPAjaxHFSQL 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.
// Procedure used to add a product
FUNCTION bAddProduct(sProductName, sImage)
 
Product name
PRODUCT.NAME = sProductName
 
// Product image
IF HLinkMemo(PRODUCT,PHOTO, sImage, hMemoImg) = False THEN
RESULT False
END
 
// Adds the product to the product file
IF HAdd(PRODUCT) = False THEN
RESULT False
END
 
RETURN True
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help