图4-4 用户注册界面
注册控件编码:
Private Sub cmdReg_Click() 'Dim cmd As Command
Usertype = General State = 1
Set cmd = New Command
DataE.Connections("conLibrary").Open
cmd.ActiveConnection = DataE.Connections("conLibrary") http://www.77cn.com.cnmandText = "insert into UserTable(UserName,RealName,Unit,pwd,RegisterTime,age,state,usertype) values('" & txtUserName.Text & "','" & txtRealname.Text & "','" & txtUnit.Text & "','" & txtPassword.Text & "','" & Now & "','" & udAge.Value & "','" & State & "','" & Usertype & "')"
http://www.77cn.com.cnmandText = "select * from usertable where username='" & txtUserName & "'"
'子段不要使用关键字“PassWord” '验证重要信息已经填写
If txtUserName.Text = "" Then
MsgBox "请填写用户名!", vbOKOnly + vbInformation, "注意" txtUserName.SetFocus Exit Sub
ElseIf txtPassword.Text = "" Then
MsgBox "请填写密码!", vbOKOnly + vbInformation, "注意"