MySQL Forums
Forum List  »  Microsoft Access

DAO seek Method
Posted by: Giorgio Schembari
Date: June 05, 2013 03:33AM

I have to migrate an application from Access to MySql
I use ADO and ODBC MySQL 5.2 w Driver instead of DAO.
In the old application I was using the Seek method of DAO to access MsAccess table, As the seek method of ADO does not work with MySql I tried the Open method of the ADO Recordset object but is much slower:

Example1: VB6, ADO, with 600,000 Records Table = > time spent 11 seconds

For X = 0 To 10000
sql = "SELECT * FROM MyTable WHERE Id = 123456789"
RsADO.Open sql, cn, adOpenDynamic, adLockOptimistic
RsADO.Close

sql = "SELECT * FROM MyTable WHERE Id = 987654321"
RsADO.Open sql, cn, adOpenDynamic, adLockOptimistic
RsADO.Close
Next


Example2: VB6, DAO, with 600,000 Records Table => 0.06 sec Time seconds

RsDAO.Index = "Id"
For X = 0 To 10000
RsDAO.Seek "=", 123456789#

RsDAO.Seek "=", 987654321#
Next


Is there a way to have the same performance of the Seek method with ADO and MySql?

Thank you

Options: ReplyQuote


Subject
Views
Written By
Posted
DAO seek Method
3717
June 05, 2013 03:33AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.