VB+SQL编程问题,运行错误,求高人解答
上面是我用VB+SQL实现的学生记录查询界面,代码如下:
Private Sub Command1_Click()
Adodc2.RecordSource = "select * from student where sclass'" + DataCombo1.Text + "'"
Adodc2.Refresh
List1.Clear
List1.AddItem ("学号 姓名 性别 出生日期")
List1.AddItem ("===========================")
Do While Not Adodc2.Recordset.EOF
List1.AddItem (Adodc2.Recordset.Fields(0) + " " + Adodc2.Recordset.Fields(1) + " " + Adodc2.Recordset.Fields(2) + " " + Trim(Str(Year(Adodc2.Recordset.Fields(3)))) + "年" + Trim(Str(Month(Adodc2.Recordset.Fields(3)))) + "月" + Trim(Str(Day(Adodc2.Recordset.Fields(3)))) + "日")
Adodc2.Recordset.MoveNext
Loop
End Sub
但是运行之后出现如下错误:
请高人帮帮忙 在此谢谢了!