Private Sub Command1_Click() With Adodc1.Recordset .MoveFirst Do While Not .EOF On Error Resume Next If .Fields("yonghuming") = Text1.Text And .Fields("mima") = Text2.Text Then gwkh = .Fields("gukh") ''''管理员是没有购物卡号的,所以上面出错跳到下一条 dengluming = Trim(Text1.Text) mima = Text2.Text Exit Do End If .MoveNext Loop If Not .EOF Then MsgBox "欢迎您的使用", vbOKOnly, "通过验证" If denglu = "guanliyuan" Then MDIForm1.menuglcz.Visible = True Else MDIForm1.menuptcz.Visible = True End If MDIForm1.menutd.Visible = True MDIForm1.menu1.Visible = False MDIForm1.menudenglu.Visible = False MDIForm1.Toolbar1.Buttons.Remove 1 MDIForm1.Toolbar1.Buttons.Remove 1 dengluming = Text1.Text Unload Me Else MsgBox "您输入的用户名或密码出错了", vbOKOnly, "无法通过验证" Text2.Text = "" Text2.SetFocus End If End With End Sub
Private Sub Command2_Click() MDIForm1.menudenglu.Visible = True denglu = "" Unload Me End Sub
Private Sub Form_Activate() frmdenglu.Left = 2200 frmdenglu.Top = 1500 Adodc1.Refresh End Sub
Private Sub Form_Load() Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & App.Path & "\vbdata\vbdata.mdb;Mode=ReadWrite" Adodc1.CommandType = adCmdTable If denglu = "guanliyuan" Then Adodc1.RecordSource = "guanliyuan" Me.Caption = "管理员登陆窗体" Else Adodc1.RecordSource = "putongyonghu" Me.Caption = "普通用户登陆窗体" End If End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) If dengluming = "" Then Command2_Click End If Call remdi End Sub
Private Sub Label3_Click()
End Sub