英语翻译Private Sub cmdOK_Click()Dim SQL As StringDim rs As ADOD
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/12 16:29:54
英语翻译
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 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水平太差.
这是一个注册用户的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 Su
英语翻译Private Sub cmdOK_Click()Dim SQL As StringDim rs As ADOD
英语翻译Private Sub Form_Click()Dim a(1 To 10) As Integer,i%,max
Private Sub Form_Click() Dim a As Integer,b As Integer,k As
Private Sub Command1_Click() Dim i As Double,M As Double,L A
Private Sub Command1_Click() Dim i As Integer,s As Integer,n
0402 Private Sub Command1_Click() Dim a As Single,b As Singl
Private Sub Command1_Click() Dim x As Single,y As Single Pic
33.设有如下程序Private Sub Command1_Click( )Dim sum As Double,x As
用vb 求π Private Sub Form_Click()Dim i As Long,pi As Double,k
Private Sub Command1_Click() Dim i,j As Integer For i = 3 To
循环语句解释Private Sub CommandButton1_Click() Dim icell,x,m,y As
几道VB程序题,Private Sub Command1_Click()Dim x As Integerx = Val(