英语翻译Private Sub cmdOK_Click()Dim SQL As StringDim rs As ADODB.RecordsetIf Trim(UserName.Text) = "" Then MsgBox "请输入用户名称!",vbOKOnly + vbExclamation,"警告"Exit SubUserName.SetFocusElseSQL = "select * from UserInfo where UserID='

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 11:03:32
英语翻译Private Sub cmdOK_Click()Dim SQL As StringDim rs As ADODB.RecordsetIf Trim(UserName.Text) =
xVRF~]ՈfB 3L:-4#'2# JL 86CI`p`;%S5.v%ޢZK^¶tz;|;4;bJY*mUyQ`rnBљnG>@_- &uUVP[``TF M'0Q߷~%F%aJZ0 S%Jt -͟ 8YAyX;A%#|c u9u|6׸Y'LJx,4E4IҤ3(ЕJ8?[Դ.s(e5z~сCqn~f߉Qǯsl/R[4)V]x0UӝrlfcΨWE׬sY! +zU>V)̉{6 먞i,Qj<͖2w[V)㏍Z:|u&E<0B_xh: %cwQWu=O^*D7ZY5sET|N]6~S~%\?O_N8 z\1G50IGm熒Y\VPwVWcK6i2z cJ/ ^:(Y6_TQf&`&"LX_su;$V\]&2XLK5*[asEKY{Y_d\j.-F\apeD-yzh6HgA<.D,ejSETj@F#we$y:Otxog\an=~=bP*t8

英语翻译Private Sub cmdOK_Click()Dim SQL As StringDim rs As ADODB.RecordsetIf Trim(UserName.Text) = "" Then MsgBox "请输入用户名称!",vbOKOnly + vbExclamation,"警告"Exit SubUserName.SetFocusElseSQL = "select * from UserInfo where UserID='
英语翻译
Private Sub cmdOK_Click()
Dim SQL As String
Dim rs As ADODB.Recordset
If Trim(UserName.Text) = "" Then MsgBox "请输入用户名称!",vbOKOnly + vbExclamation,"警告"
Exit Sub
UserName.SetFocus
Else
SQL = "select * from UserInfo where UserID='" & UserName & "'"
Set rs = TransactSQL(SQL)
If rs.EOF = False Then MsgBox "这个用户已经存在!请重新输入用户名称!",vbOKOnly + vbExclamation,"警告"
UserName.SetFocus
UserName.Text = ""
PassWord.Text = ""
confirmPWD.Text = ""
Exit Sub
Else
If Trim(PassWord.Text) Trim(confirmPWD.Text) Then MsgBox "两次输入的密码不一致,请重新输入密码!",vbOKOnly + vbExclamation,"警告"
PassWord.Text = ""
confirmPWD.Text = ""
PassWord.SetFocus
Exit Sub
ElseIf Trim(PassWord.Text) = "" Then MsgBox "密码不能为空!",vbOKOnly + vbExclamation,"警告"
PassWord.Text = ""
confirmPWD = ""
PassWord.SetFocus
Else SQL = "insert into UserInfo (UserID,UserPWD) values('" & UserName
SQL = SQL & "','" & PassWord & "')"
TransactSQL (SQL)
MsgBox "添加成功!",vbOKOnly + vbExclamation,"添加结果"
UserName.Text = ""
PassWord.Text = ""
confirmPWD.Text = ""
UserName.SetFocus
End If
End If
End If
End Sub
Private Sub cmdOK_Click()
Dim SQL As String
Dim rs As ADODB.Recordset
本人VB水平太差.

英语翻译Private Sub cmdOK_Click()Dim SQL As StringDim rs As ADODB.RecordsetIf Trim(UserName.Text) = "" Then MsgBox "请输入用户名称!",vbOKOnly + vbExclamation,"警告"Exit SubUserName.SetFocusElseSQL = "select * from UserInfo where UserID='
这是一个注册用户的VB小程序.很简单的.我都不知道该怎么解释.Private Sub cmdOK_Click() Dim SQL As String Dim rs As ADODB.Recordset ’以下是判断输入的用户名是否为空,是的话就弹出只有确定的警告窗口.If Trim(UserName.Text) = "" Then MsgBox "请输入用户名称!",vbOKOnly + vbExclamation,"警告" Exit Sub '用户名输入框重获焦点 UserName.SetFocus ’如不为空,则在表UserInfo查询名 UserName 的记录 Else SQL = "select * from UserInfo where UserID='" & UserName & "'" Set rs = TransactSQL(SQL) '如果 rs.EOF = False 即找到相同的用户名,并弹出用户名已存在警告框.If rs.EOF = False Then MsgBox "这个用户已经存在!请重新输入用户名称!",vbOKOnly + vbExclamation,"警告" ’重获焦点并清空输入的内容 UserName.SetFocus UserName.Text = "" PassWord.Text = "" confirmPWD.Text = "" Exit Sub Else ’判断密码是否为空、两次密码输入是否一致.If Trim(PassWord.Text) Trim(confirmPWD.Text) Then MsgBox "两次输入的密码不一致,请重新输入密码!",vbOKOnly + vbExclamation,"警告" PassWord.Text = "" confirmPWD.Text = "" PassWord.SetFocus Exit Sub ElseIf Trim(PassWord.Text) = "" Then MsgBox "密码不能为空!",vbOKOnly + vbExclamation,"警告" PassWord.Text = "" confirmPWD = "" PassWord.SetFocus ’若一致则,执行SQL语句吧记录写入数据库,并弹出添加成功警告窗,并清空各输入栏,以便下次输入.Else SQL = "insert into UserInfo (UserID,UserPWD) values('" & UserName SQL = SQL & "','" & PassWord & "')" TransactSQL (SQL) MsgBox "添加成功!",vbOKOnly + vbExclamation,"添加结果" UserName.Text = "" PassWord.Text = "" confirmPWD.Text = "" UserName.SetFocus End If End If End If End Sub