Private Sub Command1_Click()
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim r2 As New ADODB.Recordset
Dim cnb As New ADODB.Connection
Dim cstring As String
cstring = ";Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\文件\程序\小程序\db1.mdb;Persist Security Info=False"
If Combo1.Text = "编号" Then
Set cn = New ADODB.Connection
cn.Open cstring
Set r2 = New ADODB.Recordset
With r2
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.Open "select * from table1 where 编号=" & Text1.Text, cn, adOpenDynamic, adLockOptimistic