我使用典型的ADO Jet OLE 4.0与VB6连接。例如:
Set CONN = New ADODB.Connection
With CONN
.Open _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\DATABASE\QA1.mdb;" & _
"Jet OLEDB:Engine Type=4;"
.Properties("Jet OLEDB:Max Locks Per File") = 25000000
End With
我打开记录集:
Set RSTX = New ADODB.Recordset
RSTX.CursorLocation = adUseClient
SQL = "SELECT ecc, ecc1, ecc2 from tab1 where ecc='2'"
RSTX.Open SQL, CNT, adOpenStatic, adLockReadOnly, adCmdText
但查询非常非常慢。可能我需要添加游标类型或完全改变我的策略。注意:WHERE子句的所有字段都已编制索引。