Dim
cnn
As
New
ADODB.Connection
Dim
rs
As
New
ADODB.Recordset
Dim
rst
As
New
ADODB.Recordset
cnn.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=class.mdb"
cnn.Open()
Dim
sql
As
String
=
"select * from class where classname like'%"
+ cclassname.Text +
"%' or ccode like'%"
+ cclassname.Text +
"%'"
rs.Open(sql,cnn,1,1)
If
Not
(rs.EOF
And
rs.BOF)
Then
cclassname.Text = rs(1).Value.ToString() &
"--"
& rs(2).Value.ToString()
End
If
Do
While
Not
rs.EOF
cclassname.Items.Add(rs(1).Value.ToString() &
"--"
& rs(2).Value.ToString())
rs.MoveNext()
Loop
rs.Close()
rs =
Nothing
cnn.Close()