PRB: DAO Field Object Assignment Slows as Field Count Increases (199156)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q199156 SYMPTOMS
Assigning values to DAO recordset Field objects is slow for recordsets with many fields. (This may be perceived as slow database edits or updates). Note that the affected code is:
rs.Fields(x) =<value>
and not:
rs.Update, rs.Edit, or rs.AddNew
If these methods are slow, it is likely a different problem.
RESOLUTION
There are two ways to work around this problem.
One possibility is to use DAO 3.0 rather than DAO 3.5 or DAO 3.51. This can be done by changing the library selected in Visual Basic's References dialog. Use the References command on the Project menu to view this dialog.
NOTE: DAO 3.0 is not distributed with Visual Basic 5.0 or Visual Basic 6.0.
You can also work around this problem by using a DDL (Data Definition Language) query rather than DAO code to create the tables. If the application's database already exists, DDL can be used to create a copy of the table in a new database, and DML (Data Manipulation Language) statements, such as INSERT INTO, can be used to move the data to the new database. For more information on creating tables via DDL, read the "CREATE TABLE Statement" Help topic in the Visual Basic on-line Help.
STATUS
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
Modification Type: | Major | Last Reviewed: | 10/15/2002 |
---|
Keywords: | kbBug kbDatabase kbprb KB199156 |
---|
|