我的登陆框源代码是这样的! Dim i As Integer Private Sub Combo1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Command1.SetFocus End If End Sub Private Sub Command1_Click()
Set adors = adoCon.Execute("select * from 用户表 where 用户姓名=ltrim('" & Text1 & "') and 密码=ltrim('" & Text2 & "') and 用户类型=ltrim('" & Combo1.Text & "')") If adors.EOF Then MsgBox "您输入的信息有误,请重新输入!", , "系统提示" Text1 = "" Text2 = "" Text1.SetFocus i = i + 1 If i = 3 Then MsgBox "对不起,您已无权使用本系统!", , "系统提示" Unload Me End If Else Select Case adors!用户类型 Case "管理员"
Case "普通用户" MDIForm1.mnuyydelete.Enabled = False MDIForm1.mnusyscsh.Enabled = False MDIForm1.mnuglyset.Enabled = False End Select MDIForm1.Show adors.Close Unload Me End If End Sub Private Sub Command2_Click() Unload Me 'adoRs.Close End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Text2.SetFocus End If End Sub Private Sub Text2_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Combo1.SetFocus End If End Sub 运行时出现了3704的错误,不知道是怎么回事!~ 出错提示是这句: Set adors = adoCon.Execute("select * from 用户表 where 用户姓名=ltrim('" & Text1 & "') and 密码=ltrim('" & Text2 & "') and 用户类型=ltrim('" & Combo1.Text & "')") 实在不知是怎么回事...
If KeyAscii = 13 Then
Command1.SetFocus
End If
End Sub Private Sub Command1_Click()
Set adors = adoCon.Execute("select * from 用户表 where 用户姓名=ltrim('" & Text1 & "') and 密码=ltrim('" & Text2 & "') and 用户类型=ltrim('" & Combo1.Text & "')")
If adors.EOF Then
MsgBox "您输入的信息有误,请重新输入!", , "系统提示"
Text1 = ""
Text2 = ""
Text1.SetFocus
i = i + 1
If i = 3 Then
MsgBox "对不起,您已无权使用本系统!", , "系统提示"
Unload Me
End If
Else
Select Case adors!用户类型
Case "管理员"
Case "普通用户"
MDIForm1.mnuyydelete.Enabled = False
MDIForm1.mnusyscsh.Enabled = False
MDIForm1.mnuglyset.Enabled = False
End Select
MDIForm1.Show
adors.Close
Unload Me
End If
End Sub Private Sub Command2_Click()
Unload Me
'adoRs.Close
End Sub Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Combo1.SetFocus
End If
End Sub 运行时出现了3704的错误,不知道是怎么回事!~
出错提示是这句:
Set adors = adoCon.Execute("select * from 用户表 where 用户姓名=ltrim('" & Text1 & "') and 密码=ltrim('" & Text2 & "') and 用户类型=ltrim('" & Combo1.Text & "')") 实在不知是怎么回事...