How To Copy Current Database Record into a Record Variable (97413)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 3.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
This article was previously published under Q97413 SUMMARY
Although Visual Basic version 3.0 for Windows does not provide a
direct way to assign the current database record to a record variable,
this article gives you a generic routine. Using this generic routine,
you can assign the current record, containing any number of fields,
to a record variable that represents the structure of the current
database record.
This generic routine is useful if you have existing database code that
uses record variables to represent database records. For example, using
this routine, you can use the Visual Basic data access features without
making major changes to how you read and handle records. After you
assign the contents of the current record to a record variable of the
appropriate type, your code can manipulate the record as before,
independent of the underlying database.
The routine demonstrated below requires Windows version 3.1 or later
because it uses the Windows API function hmemcpy(), which was
introduced in Windows version 3.1. An error will result on the call to
hmemcpy() if you attempt to run the sample using Windows version 3.0.
Modification Type: | Minor | Last Reviewed: | 3/2/2005 |
---|
Keywords: | kbhowto KB97413 |
---|
|