Visual Basic
This section describes the Visual Basic source modules for the Btrieve API.I
Visual Basic, when compiling a 32-bit application, aligns members of a UDT (user-defined data type) on 8-, 16-, or 32-bit boundaries, depending on the size of that particular member. Unlike structures, database rows are packed, meaning there is no unused space between fields. Because there is no way to turn alignment off, there must be some method to pack and unpack structures so that Visual Basic applications can access a database. The Pervasive Btrieve Alignment DLL, PALN32.DLL, is designed to handle this alignment issue.
In the case of Visual Basic, this language aligns elements at various multiples of bits. The following table provides various data types and shows how Visual Basic handles them:
Programs access Btrieve calls in Visual Basic by calling the BTRCALL function. Access to this function is accomplished by including the BTRAPI.BAS module in your project. The rest of the functions required reside in PALN32.DLL.
Select Project -> References and check the Pervasive Btrieve Alignment Library module. If it is not shown, add it to the list first by selecting the browse button and locating the file.
The following table includes each function and the specific module it requires.
Integer
The Btrieve status code returned by the operation. See
Status Codes and Messages for more information about a specific code.
1The field type FLD_UNICODE is used to specify a field of Visual Basic Type ‘String’ that is to be stored in UNICODE both within the database row ( packed structure ) as well as within the UDT (user-defined data type). If the field type FLD_STRING is used, it will be converted into the default ANSI code page character set of the system in the database row, although UNICODE will be used in the UDT (user-defined data type). In short, if you wish to store the string field in UNICODE in your Pervasive.SQL database, choose field type FLD_UNICODE. If you wish to store the string field in the database in the default ANSI code page character set of the system, choose FLD_STRING .