请帮我翻译一下VB的语句吧Private Sub Command1_Click() Dim mrc As ADODB.Recordset Dim MsgText As String Dim txtSQL As String If Not Testtxt(txtClassno.Text) Then MsgBox "请输入班号!", vbOKOnly + vbExclamation, "
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 02:14:47
请帮我翻译一下VB的语句吧Private Sub Command1_Click() Dim mrc As ADODB.Recordset Dim MsgText As String Dim txtSQL As String If Not Testtxt(txtClassno.Text) Then MsgBox "请输入班号!", vbOKOnly + vbExclamation, "
请帮我翻译一下VB的语句吧
Private Sub Command1_Click()
Dim mrc As ADODB.Recordset
Dim MsgText As String
Dim txtSQL As String
If Not Testtxt(txtClassno.Text) Then
MsgBox "请输入班号!", vbOKOnly + vbExclamation, "警告"
txtClassno.SetFocus
Exit Sub
End If
If Not Testtxt(comboGrade.Text) Then
MsgBox "请选择年级!", vbOKOnly + vbExclamation, "警告"
comboGrade.SetFocus
Exit Sub
End If
If Not Testtxt(txtDirector.Text) Then
MsgBox "请输入班主任姓名!", vbOKOnly + vbExclamation, "警告"
txtDirector.SetFocus
Exit Sub
End If
If Not Testtxt(txtClassroom.Text) Then
MsgBox "请输入教室房间号!", vbOKOnly + vbExclamation, "警告"
txtClassroom.SetFocus
Exit Sub
End If
If Not IsNumeric(Trim(txtClassno.Text)) Then
MsgBox "请输入数字!", vbOKOnly + vbExclamation, "警告"
Exit Sub
txtClassno.SetFocus
End If
txtSQL = "select * from class_Info "
Set mrc = ExecuteSQL(txtSQL, MsgText)
mrc.MoveFirst
While (mrc.EOF = False)
If (Trim(mrc.Fields(0)) = Trim(txtClassno.Text)) Then
MsgBox "班号已经存在,请重新输入班号!", vbOKOnly + vbExclamation, "警告"
Exit Sub
txtClassno.Text = ""
txtClassno.SetFocus
Else
mrc.MoveNext
End If
Wend
mrc.AddNew
mrc.Fields(0) = Trim(txtClassno.Text)
mrc.Fields(1) = Trim(comboGrade.Text)
mrc.Fields(2) = Trim(txtDirector.Text)
mrc.Fields(3) = Trim(txtClassroom.Text)
mrc.Update
mrc.Close
MsgBox "添加班级信息成功!", vbOKOnly + vbExclamation, "添加班级信息"
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
comboGrade.AddItem "大学一年级"
comboGrade.AddItem "大学二年级"
comboGrade.AddItem "大学三年级"
comboGrade.AddItem "大学四年级"
'comboGrade.AddItem "高中二年级"
'comboGrade.AddItem "高中三年级"
End Sub
请帮我翻译一下VB的语句吧Private Sub Command1_Click() Dim mrc As ADODB.Recordset Dim MsgText As String Dim txtSQL As String If Not Testtxt(txtClassno.Text) Then MsgBox "请输入班号!", vbOKOnly + vbExclamation, "
私有潜水艇Command1_Click() 昏暗的mrc 作为ADODB.Recordset 黯淡MsgText 当串昏暗的txtSQL 作为串
如果没有Testtxt(txtClassno.Text) 然后MsgBox ",vbOKOnly + vbExclamation," txtClassno.SetFocus 出口潜水艇末端如果
如果没有Testtxt(comboGrade.Text) 然后MsgBox ",vbOKOnly + vbExclamation," comboGrade.SetFocus 出口潜水艇末端如果
如果没有Testtxt(txtDirector.Text) 然后MsgBox ",vbOKOnly + vbExclamation," txtDirector.SetFocus 出口潜水艇末端如果
如果没有Testtxt(txtClassroom.Text) 然后MsgBox ",vbOKOnly + vbExclamation," txtClassroom.SetFocus 出口潜水艇末端如果
如果没有IsNumeric(Trim(txtClassno.Text)) 然后MsgBox ",vbOKOnly + vbExclamation," 退出次级txtClassno.SetFocus 末端如果
txtSQL = "精选* 从class_Info" 设置mrc = ExecuteSQL(txtSQL,MsgText) mrc.MoveFirst
当(mrc.EOF = 假) 如果(Trim(mrc.Fields(0)) = Trim(txtClassno.Text)) 然后MsgBox ",vbOKOnly + vbExclamation," 退出次级txtClassno.Text = "" txtClassno.SetFocus mrc.MoveNext 末端如果走向
mrc.AddNew mrc.Fields(0) = Trim(txtClassno.Text) mrc.Fields(1) = Trim(comboGrade.Text) mrc.Fields(2) = Trim(txtDirector.Text) mrc.Fields(3) = Trim(txtClassroom.Text) mrc.Update mrc.Close MsgBox ",vbOKOnly + vbExclamation,"
末端潜水艇
私有潜水艇Command2_Click() 卸载我末端潜水艇
私有次级Form_Load() comboGrade.AddItem " comboGrade.AddItem " comboGrade.AddItem " comboGrade.AddItem " ' comboGrade.AddItem " ' comboGrade.AddItem " 末端潜水艇
怪怪的!哈哈!