Dim cn As New ADODB.Connection Dim sr As New ADODB.Recordset Dim jibie As Integer cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=(我的student表);Data Source=(你的服务器名字)" sr.Open "select * from TABLE1 where 姓名='" & Text1.Text & " '", cn, 1, 3 If sr.EOF =