我想连到数据库中取得学生信息,为什么练不上?代码错了吗?
Adodc1.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=yonghu.accdb;Persist Security Info=False"If banji = "" Then
Adodc1.RecordSource = "select * from 学生信息表 where 姓名 like '*" & pxf & "*'"
ElseIf pxf = "" Then
Adodc1.RecordSource = "select * from 学生信息表 where 班级 ='" & banji & "'"
Else
Adodc1.RecordSource = "select * from 学生信息表 where 姓名 like '*" & pxf & "*' and 班级 ='" & banji & "'"
Set DataList1.DataSource = adodcl
DataList1.DataField = "姓名"
Set DataList1.DataSource = adodcl
DataList1.DataField = "学号"
Set DataList1.DataSource = adodcl
DataList1.DataField = "班级"
Set DataList1.DataSource = adodcl
DataList1.DataField = "班主任"
Set DataList1.DataSource = adodcl
DataList1.DataField = "需补考科目"
Set DataList1.DataSource = adodcl
DataList1.DataField = "参不参加分流考"