请高手来给翻译一段VB代码

来源:百度知道 编辑:UC知道 时间:2024/09/28 15:41:16
请各位高手帮我翻译下这段代码,不用太详细,重要的控件和代码部分翻译出来就可以,小弟先谢谢拉!

学生档案查询窗体
主要代码如下:

Private Sub Command1_Click()
Dim aa As Integer
txtsql = ""
If Trim(Text1(0).Text) <> "" Then
aa = 1
If txtsql = "" Then
txtsql = "xj.学号='" & Trim(Text1(0).Text) & "'"
Else
txtsql = txtsql & "and xj.学号='" & Trim(Text1(0).Text) & "'"
End If
End If
If Trim(Text1(1).Text) <> "" Then
aa = 1
If txtsql = "" Then
txtsql = "xj.姓名='" & Trim(Text1(1).Text) & "'"
Else
txtsql = txtsql & "and xj.姓名='" & Trim(Text1(1).Text) & "'"
End If
End If
If Trim(Text1(2).Text) <> "" Then
aa = 1
If txtsql = "" Then
txtsql = "xj.班级='" & Trim(Text1(2).Text) & "

Private Sub Command1_Click() //这个不用注释了吧
Dim aa As Integer //定义一个整型变量
txtsql = "" //定义一个字符串
If Trim(Text1(0).Text) <> "" Then //去掉两端空格并判断是否为空
aa = 1 //给变量1
If txtsql = "" Then //判断字符串是否为空
txtsql = "xj.学号='" & Trim(Text1(0).Text) & "'" //为空则赋值
Else
txtsql = txtsql & "and xj.学号='" & Trim(Text1(0).Text) & "'" //不为空则
End If
End If
If Trim(Text1(1).Text) <> "" Then //类似
aa = 1
If txtsql = "" Then
txtsql = "xj.姓名='" & Trim(Text1(1).Text) & "'"
Else
txtsql = txtsql & "and xj.姓名='" & Trim(Text1(1).Text) & "'"
End If
End If
If Trim(Text1(2).Text) <> "" Then //类似
aa = 1
If txtsql = "" Then
txtsql = "xj.班级='" & Trim(Text1(2).Text) & "'"
Els