With conn
If .State = 1 Then
.Close
End If
.CursorLocation = adUseClient
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & strSQL
.Open
End With
With rs
.Open "SELECT Id, IDvalue FROM Table1 WHERE IDvalue = '" & ltext & "' ORDER BY Id;", conn, adOpenStatic, adLockOptimistic
if .BOF and .EOF then
N=0
msgbox "没有查到任何记录!"
exit sub
end if
.movefirst
.movelast
N=.recordcount
msgbox "查到" & N & "条记录!"
End With
'退出时
rs.close
conn.close
set rs =nothing
set conn=nothing
Private Sub Command5_Click()
With form2
.Show
.Move 0, 0
.txtBH.Text = xzgl_gwyscld.Text5.Text
.Adodc1.RecordSource = "select * form XZ_XZGL_QSYSCLD where XXQ_BH='" & Trim(.txtBH) & "'"
End With
End Sub
自己写的大家看看查询语句怎么改才能实现?