注册 登录
编程论坛 VB6论坛

rs.open 错误13

heiker0088 发布于 2013-04-05 23:11, 458 次点击
Private Sub cmd1_Click()
Dim conn As New ADODB.Connection
 Dim rs As New ADODB.Recordset
 Dim strsql As String
 Dim uname As String
 
 conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db4.mdb;Mode=ReadWrite;Persist Security Info=False;Jet OLE DB:"
 
  uname = Trim(txt1.Text)
  upwd = Trim(txt2.Text)
  
 If uname = "" Or upwd = "" Then
 
 MsgBox "对不起,用户、密码不能为空!请重新输入!!"
 
  strsql = "select * from db4 where 用户名= '" & uname & " 'and 用户口令 = '" & upwd & "'"
  
  rs.Open strsql, conn, adOpenKeyset, adLockPessimistic
  
  
  If rs.EOF = True Then
  
  MsgBox "对不起!无此用户或者密码不正确!请重新输入!!"
  
  txt1.Text = ""
  txt2.Text = ""
  txt1.SetFocus
  rs.Close
  End If
  
  
Else
   Form2.Show
   Unload Me
   End If
  
End Sub



求高手解决啊,,,,,,,,,,,,,,,,,,,,,,
3 回复
#2
heiker00882013-04-05 23:32
#3
Artless2013-04-06 11:04
用户口令数据类型?
#4
bczgvip2013-04-06 16:20
密码不会是用明文密码吧?
1