PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

  • Canceling the existing association
  • Differences between BinaryLoad and HLinkMemo
  • HLinkMemo and remote access (RPC)
  • HFSQL thumbnails
  • Managing memos in SQLite
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
HLinkMemo (Function)
In french: HAttacheMémo
ODBCNot available with this kind of connection
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 into the memo only when adding or modifying the record (HAdd, HModify ou 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.
Note: 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 the HFSQL engine and with the Native Accesses.
    <FileName>.<NameMemoItem> = <BufferName>

    For example:
    bufFile is Buffer = fLoadBuffer("MyFile")
    MyFile.MyMemo = bufFile
Note: From version 19, HFSQL is the new name of HyperFileSQL.
// Attach an image to the record
HLinkMemo(Product, Product_Image, "C:\Images\Product1.gif", hMemoImg)
// 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(<File name> , <Item name> [, <File to attach> [, <Type> [, <Information>]]])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred. 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.
<File name>: Character string (with or without quotes)
Name of the data file (or query) containing a memo item. If only <File name> and <Item name> are specified, HLinkMemo cancels the association found between the binary file and the item.
<Item name>: Character string (with or without quotes)
Name of the memo item of the data file into which the binary file must be added. If only <File name> and <Item name> are specified, HLinkMemo cancels the association found 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 attachment is deleted.
<Type>: Optional combination of Integer constants
Specifies the file type and the mode for reading the file.
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.
PHPOLE DBNative Connectors (Native Accesses) This parameter is ignored.
<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.
PHPOLE DBNative Connectors (Native Accesses) This parameter is ignored.
Versions 19 and later
WEBDEV - 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 occurred. 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 attachment 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 attachment is deleted.
<Type>: Optional combination of Integer constants
Specifies the file type and the mode for reading the file.
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.
New in version 19
WEBDEV - 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 occurred. 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 attachment 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 attachment is deleted.
<Type>: Optional combination of Integer constants
Specifies the file type and the mode for reading the file.
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.
WEBDEV - 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 occurred. 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 attachment 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 attachment is deleted.
<Type>: Optional combination of Integer constants
Specifies the file type and the mode for reading the file.
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 association

If only <File name> and <Item name> are specified, HLinkMemo cancels the association found between the binary file and the item.
WEBDEV - Server codeAjaxHFSQLHFSQL Client/ServerStored proceduresHyper File 5.5OLE DBNative Connectors (Native Accesses)

Differences between BinaryLoad and HLinkMemo

Unlike BinaryLoad, 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.
WEBDEV - Server codeAjaxStored procedures

HLinkMemo and remote access (RPC)

HLinkMemo searches for the file to attach on the RPC server (even if the function is run locally on a remote computer).
To insert into a memo a file found locally and not on the RPC server, the memo item must be assigned with its full content, without calling HLinkMemo.
Example: Insert from a WINDEV Mobile application an image found in the executable directory:
sImage is string
sImage = fExeDir() + "\signature.jpg"
FileBuffer is Buffer
FileBuffer = fLoadText(sImage)
FileOnRPCServer.ImageItem = UnicodeToAnsi(FileBuffer)
HAdd(FileOnRPCServer)
The image is sent to the RPC server during the addition. The RPC server includes it into the memo, whether the connection to the database is established via OLE DB or via native access.
WEBDEV - Server codeAjaxHFSQLHFSQL Client/ServerStored procedures

HFSQL thumbnails

If the item is using HFSQL thumbnails, the thumbnails will be automatically generated with the new file when adding or modifying the record (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 : wd240hf.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment