刚才看到vb使用sql语句查询excel的问题,您是怎么解决的啊
strSql="SELECTD880FROM[H:book1.xls].[sheet1$]whereTE='"&Trim(ts.Text)&"'"...
strSql = "SELECT D880 FROM [H:book1.xls].[sheet1$] where TE= '" & Trim(ts.Text) & "'"
展开
展开全部
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=H:\book1.xls" & ";Extended Properties='Excel 8.0;HDR=Yes'"
sql = "select D880 from [Sheet1$] where TE= '" & Trim(ts.Text) & "'"
Adodc1.RecordSource = sql
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询