云风,你好!我是一个编程爱好者,现在我遇到一个问题,想请教你一下。我做了一个系统登录的界面,并且连接到了Access数据库,代码是这样的
Private Sub Command1_Click()
Dim strSq1 As String
Dim rs As New ADODB.Recordset
If Trim(
Text1?.Text =
Text1?.
SetFocus?
Exit Sub
Else
strSq1 = "select * from 系统管理 where Name= '" &
Text1?.Text & "'"
rs.Open strSq1, cnn, adOpenKeyset, adLockPessimistic
If rs.EOF = True Then
MsgBox? "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
Text1?.
SetFocus?
Exit Sub
Else
If Trim(
Text2?.Text) = Trim(rs.Fields(2)) Then
rs.Fields(1) =
Text1?.Text
rs.Fields(2) =
Text2?.Text
rs.Close
Unload Me
main.Show
Else
MsgBox? "密码不正确!", vbOKOnly + vbExclamation, "提示"
Text2?.
SetFocus?
End If
End If
End If
End Sub
Private Sub Form_Load()
Dim cnn As New ADODB.Connection
Dim connectionstring As String
connectionstring = "provider=Microsoft.Jet.oledb.4.0;" & " data source=通讯录.mdb"
cnn.Open connectionstring
End Sub、
但一运行就提示错误事实错误“3001” 类型不正确,或不在可接受范围内,或与其他参数冲突,请问你是怎么回事,谢谢你了