Jrsgth丨 14:21:51
Sub createconnection()
Dim contr As String
Set cn = New ADODB.connection
cn.CursorLocation = adUseClient
cn.Provider = "Microsoft.Jet.OLEDB.4.0;"
constr = "data source =C:\Documents and Settings\Administrator\桌面\Database3.accdb;"
cn.Open constr
MsgBox "已经创建了一个到C:\Documents and Settings\Administrator\桌面\Database3.accdb的ADO连接"
End Sub
Private Sub ReadFromDB1()
'链接
Call createconnection
'查询柄部的数据
Set rst = New ADODB.Recordset
rst.CursorLocation = adUseClient
rst.Open "SELECT *FROM 前柄尺寸表", cn, adOpenForwardOnly, adLockBatchOptimistic, adCmdText
rst.MoveFirst
Dim i As Integer, d0 As Double
d0 = TextBox2.Text - 1
If 12 |