Private Sub Command2_Click()
Print "sql " & Timer
Dim Cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strCn As String
Dim Sql As String
Dim i As Integer
Cn.ConnectionString = "Provider=SQLOLEDB.1;Password=896123212;Persist Security Info=True;User ID=sa;Initial Catalog=qqdata;Data Source=LEN-PC\SQLEXPRESS"
Set rs = CreateObject("ADODB.Recordset")
Sql = "select * from abc"
Set rs = New ADODB.Recordset
Cn.Open
rs.Open Sql, Cn, 1, 3
While i < 10000
rs.AddNew
rs("uid").Value = i
i = i + 1
Wend
rs.Update
rs.Close
Cn.Close
Print Timer
End Sub
Private Sub Command3_Click()
Print "access " & Timer
Dim conn As New ADODB.Connection
Dim rs As ADODB.Recordset
Dim FileName As String
Dim Cn As String, Sql As String
Dim i As Long
i = 1
FileName = App.Path & "\data.mdb" '数据库文件地址
Cn = "PROVIDER=microsoft.jet.oledb.3.51;persist security info =false;data source=" & FileName & ";Jet OLEDB:Database Password="
Sql = "select * from abc"
Set rs = New ADODB.Recordset
rs.Open Sql, Cn, 1, 3
While i < 10000
rs.AddNew
rs("uid").Value = i
i = i + 1
Wend
rs.Update
rs.Close
Print Timer
End Sub