VB查询怎样写代码
发布网友
发布时间:2022-04-29 18:27
我来回答
共3个回答
热心网友
时间:2022-06-19 01:35
想学VB我教你呀。
代码如下:
On Error Resume Next
If Combo1.Text = "" Then
datagrid1.visible=false
Else
Dim cnn1 As ADODB.Connection
Dim rs1 As ADODB.Recordset
Dim s1 As String
Set cnn1 = New Connection
s1 = "select * from customer where 省份 like '%" & Trim(Combo1.Text) & "%' order by 更新的时间 desc "
cnn1.Provider = "Microsoft.Jet.OLEDB.3.51"
cnn1.Open App.Path & "\customer.mdb"
Set rs1 = New Recordset
rs1.CursorLocation = adUseClient
rs1.Open s1, cnn1, adOpenStatic, adLockReadOnly
Set DataGrid1.DataSource = rs1
热心网友
时间:2022-06-19 01:35
2楼写的知识查询哦,没有涉及过滤哈
热心网友
时间:2022-06-19 01:35
0分问这个问题吗?