Hi,
I am using the MyODBC driver to connect to a MySQL-Server via ADO and VB.
Now I tried to use the MyOleDB driver which should result in a better performance. Here is the code.
Dim dbconn As ADODB.Connection
Dim adoRecordset As ADODB.Recordset
Set dbconn = New ADODB.Connection
dbconn.Provider = "MySQLProv"
dbconn.Properties("Data Source" = "DSN=TestOleDBMySQL;SERVER=TestServer;DB=TestDB"
dbconn.Properties("User Id" = "testUser"
dbconn.Properties("Password" = "testUser"
dbconn.Open
Set adoRecordset = New Recordset
Set adoRecordset.ActiveConnection = dbconn
adoRecordset.CursorLocation = adUseClient
adoRecordset.LockType = adLockReadOnly
adoRecordset.CursorType = adOpenKeyset
adoRecordset.Open "Select * From TestTable"
Set adoRecordset.ActiveConnection = Nothing
It works but really slowly.
Can somebody tell me why ?
Thanks
I am using the MyODBC driver to connect to a MySQL-Server via ADO and VB.
Now I tried to use the MyOleDB driver which should result in a better performance. Here is the code.
Dim dbconn As ADODB.Connection
Dim adoRecordset As ADODB.Recordset
Set dbconn = New ADODB.Connection
dbconn.Provider = "MySQLProv"
dbconn.Properties("Data Source" = "DSN=TestOleDBMySQL;SERVER=TestServer;DB=TestDB"
dbconn.Properties("User Id" = "testUser"
dbconn.Properties("Password" = "testUser"
dbconn.Open
Set adoRecordset = New Recordset
Set adoRecordset.ActiveConnection = dbconn
adoRecordset.CursorLocation = adUseClient
adoRecordset.LockType = adLockReadOnly
adoRecordset.CursorType = adOpenKeyset
adoRecordset.Open "Select * From TestTable"
Set adoRecordset.ActiveConnection = Nothing
It works but really slowly.
Can somebody tell me why ?
Thanks