请给我个用vb编写的查询语句使用ADODC
1个回答
展开全部
Private Sub Command1_Click()
Dim sql
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\wd.mdb;Persist Security Info=False"
sqi = "select * from jishijilu where shijian like'%" & Text1 & "%' And gyh_riqi like'%10%'"
Adodc1.RecordSource = sql
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
Set MSHFlexGrid1.DataSource = Adodc1
End Sub
追问
可以不用datagrid1吗,换成textbox行吗
追答
Set Text1.DataSource = Adodc1
Text1.DataField = "shijian"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询