1,066
社区成员
发帖
与我相关
我的任务
分享
Dim adoConnection As New ADODB.Connection
adoConnection.ConnectionString = "省略数据库链接字"
adoConnection.Open
Dim rs As New ADODB.Recordset
rs.Open "select sht,the from chs", adoConnection, adOpenKeyset, adLockReadOnly
If rs.RecordCount >= 5 Then
rs.Move 4
If rs.Fields("sht") = text1.Text Then
text2.Text = rs.Fields("the")
End If
End If
rs.Close
Set rs = Nothing
adoConnection.Close
Set adoConnection = Nothing