题型:填空题 题类:模拟题 难易度:普通
浙江省杭州市2015年高考信息技术模拟卷5
Private Sub Command1 Click()
Dim adocn As New adodb.Connection
Dim adors As New adodb.Recordset
Dim str2 As String, str1 As String
str1 = "Provider=Microsoft.ACE.OLEDB.12.0;data source=f:\2015mt\vb\ "
adocn.Open str1
str2 = "select * from students where num=" + Text1.Text
adors.Open str2, adocn, adOpenDynamic, adLockOptimistic
If adors.EOF = True Then
MsgBox "你输入的学号不存在"
Else
Text2.Text = adors.Fields("name").Value
Text3.Text = adors.Fields("sex").Value
End If
adors.Close
adocn.Close
End Sub
试题篮