Private Sub Command4_Click()
Dim rst As New ADODB.Recordset
Dim strsql As String
strsql = "select 用户名,密码 from 用户名"""
rst.Open strsql, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
If Trim(Me.Combo13) = Trim(rst.Fields(0)) And Trim(Me.Text2) = Trim(rst.Fields(1)) Then
Dim stDocName As String
Dim stLinkCriteria As String
Else
MsgBox "登陆失败,请重新登陆"
Me.Combo13.SetFocus
End If
End Sub
作者: zhuyiwen 时间: 2011-6-4 19:26
Private Sub Command4_Click()
Dim rst As ADODB.Recordset
Dim strsql As String
strsql = "select 密码 from 用户表 WHERE 用户名='" & trim(Me.Combo13) & "'"
Set rst = CurrentProject.Connection.Execute(strsql)If Not rst.EOF Then
If Trim(Me.Text2) = Trim(rst.Fields("密码")) Then
Dim stDocName As String
Dim stLinkCriteria As String
Private Sub Command4_Click()
Dim rst As ADODB.Recordset
Dim strsql As String
strsql = "select 密码 from 用户名='" & Trim(Me.Combo13) & "'"
Set rst = CurrentProject.Connection.Execute(strsql)If Not rst.EOF Then 这里显示语法错误,运行不了啊。
If Trim(Me.Text2) = Trim(rst.Fields("密码")) Then
Dim stDocName As String
Dim stLinkCriteria As String
Else
MsgBox "登陆失败,请重新登陆"
Me.Combo13.SetFocus
End If
Else
MsgBox "登陆失败,请重新登陆"
Me.Combo13.SetFocus
End If
rst.Close
Set rs = Nothing
End Sub作者: roych 时间: 2011-6-4 21:15
那是两句滴,应该改成:
Set rst = CurrentProject.Connection.Execute(strsql)
If Not rst.EOF Then 这里显示语法错误,运行不了啊。 作者: a283054 时间: 2011-6-4 22:59 回复 roych 的帖子
[attach]45787[/attach]还是不行哦。
Private Sub Command4_Click()
Dim rst As ADODB.Recordset
Dim strsql As String
strsql = "select 密码 from 用户名='" & Trim(Me.Combo13) & "'"
Set rst = CurrentProject.Connection.Execute(strsql) 这里有问题
If Not rst.EOF Then
If Trim(Me.Text2) = Trim(rst.Fields("密码")) Then
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = ChrW(20999) & ChrW(25442) & ChrW(-26782) & ChrW(26495)
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "登陆失败,请重新登陆"
Me.Combo13.SetFocus
End If
Else
MsgBox "登陆失败,请重新登陆"
Me.Combo13.SetFocus
End If
作者: Grant 时间: 2011-6-4 23:28
strsql = "select 密码 from 用户名='" & Trim(Me.Combo13) & "'"