Private Sub Form_Load()
Dim a, b, c As String
a = Text1.Text
Dim db As New ADODB.Connection '声明数据库连接对象
Dim RS As New ADODB.Recordset '声明将来就对象
db.ConnectionString = "provider=msdasql;driver={sql server};server=XP-201205381252\SQLEXPRESS;uid=sa;pwd=UFO147258;database=A123"
db.Open
StrSql = "select * from QQ2 where ID= '" & a & "' "
b = RS.Recordset.Fields(1)
c = RS.Recordset.Fields(2)
b = Text2.Text
c = Text2.Text
End Sub
Dim a, b, c As String
a = Text1.Text
Dim db As New ADODB.Connection '声明数据库连接对象
Dim RS As New ADODB.Recordset '声明将来就对象
db.ConnectionString = "provider=msdasql;driver={sql server};server=XP-201205381252\SQLEXPRESS;uid=sa;pwd=UFO147258;database=A123"
db.Open
StrSql = "select * from QQ2 where ID= '" & a & "' "
b = RS.Recordset.Fields(1)
c = RS.Recordset.Fields(2)
b = Text2.Text
c = Text2.Text
End Sub