Public gconSys As New ADODB.Connection
Dim RsPayer As New ADODB.RecordSetstrConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\ServiceInvoice.mdb;Persist Security Info=False"
gconSys.Open strConnect
strPayerSQL = "SELECT customername FROM Customer WHERE Valid=0"
rsPayer.Open strPayerSQL, gconSys, adOpenStatic, adLockReadOnlylstPayer.Clear
Do While Not rsPayer.EOF
lstPayer.AddItem rsPayer.Fields("CustomerName").Value
rsPayer.MoveNext
Loop执行movenext时很慢,差不多要一秒后能行执行下一句.用"select *"也一样.
有人知道原因吗?
Dim RsPayer As New ADODB.RecordSetstrConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\ServiceInvoice.mdb;Persist Security Info=False"
gconSys.Open strConnect
strPayerSQL = "SELECT customername FROM Customer WHERE Valid=0"
rsPayer.Open strPayerSQL, gconSys, adOpenStatic, adLockReadOnlylstPayer.Clear
Do While Not rsPayer.EOF
lstPayer.AddItem rsPayer.Fields("CustomerName").Value
rsPayer.MoveNext
Loop执行movenext时很慢,差不多要一秒后能行执行下一句.用"select *"也一样.
有人知道原因吗?
for i=1 to num
lstPayer.AddItem rsPayer.Fields("CustomerName").Value
rsPayer.MoveNext
next
strPayerSQL = "SELECT customername FROM Customer WHERE Valid=0"
上面的SQL语句原来有个In条件,我去IN条件去了就不会慢了。这是什么原因呀?