AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Administrar bases de datos / HFSQL / Funciones HFSQL
  • 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
WINDEVCódigo de Usuario (UMC)HFSQL ClassicHFSQL Client/ServerProcedimientos almacenadosHyper File 5.5OLE DBConectores Nativos
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
WINDEVCódigo de Usuario (UMC)HFSQL ClassicHFSQL Client/ServerProcedimientos almacenadosHyper File 5.5OLE DBConectores Nativos
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
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/05/2022

Señalar un error o enviar una sugerencia | Ayuda local