ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Canceling the existing link
  • Difference between BinaryLoad and HLinkMemo
  • HFSQL thumbnails
  • Managing memos in SQLite
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Used to associate a file with a binary memo item or to cancel the existing link between a file and a binary item.
The file will be read and added to the memo only when the record is added or modified (HAdd, HModify or HWrite). The function will return an error if the file is opened in write mode and if the hAcceptOpenedFile constant was not used.
HExtractMemo will be used to extract the file contained in the memo onto the hard disk.
Remark: You also have the ability to use the direct assignment:
  • To associate an image (found in an Image control) with an image memo:
    <FileName>.<NameMemoItem> = <NameImageControl>

    For example:
    AFile.AMemoItem = IMG_AnImageControl

    This syntax can be used with both the HFSQL engine and Native Connectors.
    <FileName>.<NameMemoItem> = <BufferName>

    For example:
    bufFile is Buffer = fLoadBuffer("MyFile")
    MyFile.MyMemo = bufFile
// Attach an image to the record
HLinkMemo(Product, Product_Image, "C:\Images\Product1.gif", hMémoImg)
// Transfer the content of controls into the file buffer
ScreenToFile()
// Add the record
HAdd(Product)
Syntax

Associating a file with a binary memo item Hide the details

<Result> = HLinkMemo(<Data file> , <Item> [, <File to attach> [, <Type> [, <Information>]]])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurs. HError is used to identify the error. The function will return an error if the file to associate is opened in write mode and if the hAcceptOpenedFile constant was not used.
<Data file>: Character string
Name of the data file (or query) containing a memo item.
If only <Data file> and <Item> are specified, HLinkMemo cancels the existing link between the binary file and the item.
<Item>: Character string
Name of the memo item of the data file into which the binary file must be added.
If only <Data file> and <Item> are specified, HLinkMemo cancels the existing link between the binary file and the item.
<File to attach>: Optional character string
Name of the file that will be associated with the binary memo item. This name can correspond to:
  • the full path of the file to attach,
  • a relative path (respective to the current directory) of the file to attach.
If this parameter is not specified or if it corresponds to an empty string (""), the current link is deleted.
AndroidAndroid Widget Java If a path is specified, this path must correspond to an existing file. Otherwise, a fatal error is displayed.
<Type>: Optional combination of Integer constants
Indicates the type of file to attach and its read mode.
hAcceptOpenedFileAllows you to read the source file that will be added to the memo if this source file is opened in write mode somewhere else.
This constant can be used with the constants for file type.
hMemoBin
(default value)
The file is an ordinary binary file.
hMemoImgThe file is an image file.
hMemoOleThe file is an OLE file.
hMemoWavThe file is a sound file.

PHPOLE DBNative Connectors (Native Accesses) This parameter is ignored.
AndroidAndroid Widget Java This parameter is available for the data files in HFSQL format only.
<Information>: Optional character string
Information message (up to 65535 characters) stored with the file. This message can be read again by HInfoMemo.
PHPOLE DBNative Connectors (Native Accesses) This parameter is ignored.
AndroidAndroid Widget Java This parameter is available for the data files in HFSQL format only.
WINDEVWEBDEV - Server code

Associating a file with a binary memo item via a Record type variable Hide the details

<Result> = HLinkMemo(<Memo item> [, <File to attach> [, <Type> [, <Information>]]])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurs. HError is used to identify the error. The function will return an error if the file to associate is opened in write mode and if the hAcceptOpenedFile constant was not used.
<Memo item>: Record variable
Memo item where the binary file must be added. Use the following notation: <Name of record variable>.<Name of memo item>.
If only the <Memo item> parameter is specified, HLinkMemo cancels the existing link between the binary file and the item.
<File to attach>: Optional character string
Name of the file that will be associated with the binary memo item. This name can correspond to:
  • the full path of the file to attach,
  • a relative path (respective to the current directory) of the file to attach.
If this parameter is not specified or if it corresponds to an empty string (""), the current link is deleted.
<Type>: Optional combination of Integer constants
Indicates the type of file to attach and its read mode.
hAcceptOpenedFileAllows you to read the source file that will be added to the memo if this source file is opened in write mode somewhere else.
This constant can be used with the constants for file type.
hMemoBin
(default value)
The file is an ordinary binary file.
hMemoImgThe file is an image file.
hMemoOleThe file is an OLE file.
hMemoWavThe file is a sound file.
<Information>: Optional character string
Information message (up to 65535 characters) stored with the file. This message can be read again by HInfoMemo.
OLE DBNative Connectors (Native Accesses) This parameter is ignored.
Remarks

Canceling the existing link

If only <Data file> and <Item> are specified, HLinkMemo cancels the existing link between the binary file and the item.
WINDEVWEBDEV - Server codeReports and QueriesJavaUser code (UMC)AjaxHFSQL ClassicHFSQL Client/ServerStored proceduresHyper File 5.5OLE DBNative Connectors (Native Accesses)

Difference between BinaryLoad and HLinkMemo

Unlike BinaryLoad (kept for compatibility with WINDEV 5.5), HLinkMemo does not load the binary file in memory. Therefore, there is no risk of memory overload when a large file is associated with a binary memo item.
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppiPhone/iPadIOS WidgetMac CatalystJavaUser code (UMC)External languageAjaxHFSQL ClassicHFSQL Client/ServerStored procedures

HFSQL thumbnails

If the item uses HFSQL thumbnails, they will be automatically generated with the new file when the record is added or modified (HAdd, HModify or HWrite).
Native Connectors (Native Accesses)

Managing memos in SQLite

Storing information in memo format is recommended for the data whose size is less than 1 MB. We advise you to directly save the data in external file format on the internal or external memory of the phone and to store the access path to this data in the database.
Component: wd290hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/05/2023

Send a report | Local help