各种学习资料
图5.11注册新用户界面
实现代码:
PrivateSubCommand1_Click()
rtn=SetWindowPos(Me.hwnd,-2,0,0,0,0,3)'运用API函数SetWindowPos,来实现取消窗体置前的功能
IfText1.Text=""OrText2.Text=""OrText3.Text=""Then
MsgBox"输入的用户注册信息不完全!!",,"提示信息"
Else
Adodc1.RecordSource="select*fromtb_enterwhereM_Name='"+Text1+"'"'判断注册的用户名是否存在
Adodc1.Refresh
IfAdodc1.Recordset.RecordCount>0Then
MsgBox"该用户名已经存在,请您更换其他用户名!",48,"提示信息"
Text1.Text=""
'如果该用户名存在则重新输入
Text2.Text=""
Text3.Text=""
Text4.Text=""
Text1.SetFocus
Else
IfText3.Text=Text4.TextThen
判断两次输入的密码是否一致
Adodc1.RecordSource="select*fromtb_enterorderbyM_ID"
Adodc1.Refresh
IfAdodc1.Recordset.RecordCount>0Then
Adodc1.Recordset.MoveLast
Text5.Text
Val(Adodc1.Recordset.Fields("M_ID"))+1
Else
Text5.Text=1
EndIf
Callmain
'保存注册信息'=