Summary of Tips to Improve Data Access Speed in VB version 3.0Last reviewed: July 19, 1995Article ID: Q120172 |
The information in this article applies to:
- Professional Edition of Microsoft Visual Basic for Windows, version 3.0
SUMMARYThis article summarizes the techniques for improving the speed of data access in your database applications. There are four main points that will be covered in this article:
MORE INFORMATION
TransactionsImplementing transactions can be the most significant way to increase the speed of data access in your database application. This technique is ideal for speeding up inserting, updating, appending, or deleting data in a database. In a nutshell, transactions cache a group of operations in memory, then commit them all at once rather than committing each individual operation. They also provide a means for discarding the proposed changes (rollback). For additional information, please see the following articles in the Microsoft Knowledge Base: ARTICLE-ID: Q109830 TITLE : How to Speed Up Data Access by Using BeginTrans & CommitTransFor ODBC sources, however, transactions do have their limitations as outlined in the following article: ARTICLE-ID: Q101518 TITLE : Transactions on ODBC Data Sources in Visual Basic Version 3.0 Attached TablesUsing attached tables increases performance most when connecting to ODBC databases such as Microsoft SQL Server, Oracle, and Sybase. With attached tables, information on the table structure is cached in the Microsoft Access database. This technique increases performance when connecting to the ODBC data source because you eliminate the overhead of Visual Basic querying the ODBC data source for this table structure information. For additional information, please see the following articles in the Microsoft Knowledge Base: ARTICLE-ID: Q108423 TITLE : How to Attach an External Database Table to a VB 3.0 DatabaseARTICLE-ID: Q90100 TITLE : PRB: Remote ODBC Tables Are Read-Only Without a Unique Index ODBC: DB_SQLPassThrough and ExecuteSQLIf you do not use attached tables to connect to your ODBC data source, you can use the DB_SQLPassThrough flag when creating recordsets to increase performance. For action queries such as Insert, Delete, and Update that take action rather than returning records, you can use the ExecuteSQL method. By using DB_SQLPassThrough and ExecuteSQL, you increase performance by delegating execution of the SQL query to the client-server database via the ODBC connection. There are some limitations, however, when using DB_SQLPassThrough. Most notably, the recordset returned is Read-Only. For additional information, please see the following articles in the Microsoft Knowledge Base: ARTICLE-ID: Q106492 TITLE : How to Call SQL Stored Procedures from Visual BasicARTICLE-ID: Q115237 TITLE : How to Use Temporary Tables in SQL Server from Visual BasicARTICLE-ID: Q106111 TITLE : PRB: Illegal to Use Find Methods w/ SQL PASSTHROUGH & ODBC DBARTICLE-ID: Q103976 TITLE : FIX: Invalid Argument Err on Execute Method w/SQL Passthrough Correct Use of the Data Access Object (DAO) VariableYou can also increase performance by using the correct data access object variable(s) for your needs. To do this, you need to understand the functionality of each of the different DAO variables. Below is a brief outline of the seven main advantages and disadvantages of each of the data access object variables and the data control. Table Object:
ARTICLE-ID: Q103442 TITLE : Differences Between the Object Variables in VB Version 3.0ARTICLE-ID: Q109218 TITLE : Using Table Objects Versus Dynaset/Snapshot Objects in VBARTICLE-ID: Q103808 TITLE : Limitations of the Data Control in Visual Basic Version 3.0 |
Additional reference words: 3.00 Speed fast faster
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |