如何写程序的登陆
有现成代码么?
我的信箱是qian2241@126.com
100分
[解决办法]
网上有卖的
[解决办法]
If Combo1.Text = "" Then
MsgBox "请选择用户名称!", vbOKOnly + vbExclamation, "错误"
Combo1.SetFocus
Exit Sub
End If
Dim cn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim SqlStr As String
cn.CursorLocation = adUseClient
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.mdb;Mode=ReadWrite;Persist Security Info=False;Jet OLEDB:Database Password=7234322"
SqlStr = "Select * FROM 用户 Where 用户名称 = '" & Combo1.Text & "'"
rst.Open SqlStr, cn, adOpenDynamic, adLockOptimistic, adCmdText
If Text1.Text = rst.Fields("用户密码").Value Then
UserName = Combo1.Text
UserPower = rst.Fields("用户权限").Value
UserPass = rst.Fields("用户密码").Value
If App.Path = "C:\Program Files\xxxx管理信息" Then
MDIForm1.Show
Unload Me
Else
Me.Hide
MsgBox "您进入的是教学演示版,不能进行打印。", vbOKOnly + vbInformation, "提示信息"
MDIForm1.Show
Unload Me
End If
Else
MsgBox "用户密码错误,请重新输入!", vbOKOnly + vbExclamation, "错误"
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Text1.SetFocus
Exit Sub
End If
[解决办法]
day day up~~