VB连接数据库查询
Dim a As Integera = Val(Text1.Text)
Dim conn As ADODB.Connection
Dim rs As New ADODB.Recordset
Set conn = New ADODB.Connection
Set rs = New ADODB.Recordset
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\毕业设计\毕业设计\数据库.mdb "
conn.Open
rs.CursorLocation = adUseClient
rs.Open "select * from 总表 where 届期=" & a, conn, adOpenStatic, adLockOptimistic
Set DataGrid1.DataSource = rs
现在是一个条件,如果我还要加一个条件该如何书写?另外一个条件由b从text2.text获取。直接用and不行
追问:还是不行要不你留个邮箱我把程序发给你你调试看看