Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
zhuce.Show
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path + "\db.mdb"
End Sub
Private Sub Timer1_Timer()
If Label1.Left + 1000 > 0 Then
Label1.Left = Label1.Left - 300
Else
Label1.Left = 5000
End If
End Sub
如果想注册用户,可以通过登录界面直接点击注册按钮,将进入注册界面,注册用户。详见图5.2.2
5.2.2注册功能的实现:
注册用户功能界面图如下:
图5.2.2
用户只要填写用户名和密码后,点击确定按钮就可以注册用户。注册窗体的详细代码如下:
Private Sub Form_Load()
Data1.DatabaseName = App.Path + "\db.mdb"
End Sub
Private Sub Picture2_Click()
Dim aa As String
If Trim(Text1.Text) = "" Then
MsgBox "请输入用户名称!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Exit Sub
Else
Data1.RecordSource = "select * from load where name='" & aa & "'"
While Data1.Recordset.EOF = False
If Trim(Data1.Recordset.Fields(0)) = Trim(Text1) Then
MsgBox "用户已经存在,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Text2.Text = ""
Text1.Text = ""
Text3.Text = ""
Exit Sub
Else
Data1.Recordset.MoveNext
End If
Wend
End If
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>