Adodc1.RecordSource = "select Instore.ProId as 产品编号,ProName as 产品名称,Quantity as 数量,Hand as 经手人,InstoreCode as 票号,Instore.Indate as 日期 From Instore Join Product on dbo.Instore.ProId=dbo.Product.ProId where Instore.Indate between '" + Str(DTP1.Value) + "' and '" + Str(DTP2.Value) + "' and " & a & " Like '" + Text1.Text + "+ % +" '提示LIKE 附近有语法错误?
解决方案 »
- 急求高人:我在本机上写的一个程序,访问了access,其他机子上报错,msadodc.ocx,不能运行,如何让其能一处书写,到处运行呢?听说打包,但具体如何做,谢谢
- 字符串相似
- 如何编程读取一个数据库的所有数据表?
- 数据库表中一个字段存的是日期,怎样用当前日期减去这个字段的值作为一个字段显示
- 这个问题我感觉很难啊:怎样得到Excel回归公式的系数?
- 有一关于ADODC的问题像向大家请教
- 请问怎样能彻底清除ie垃圾?
- 请教一个用vb做菜单的问题
- 请问如何向c那样使字符串有格式????
- 关于数据显示时合并的问题?????
- VB如何访问远程组件?
- 请问这断VC的API怎么在VB里声明?(在线等待,立即给分)
看看出来的结果是什么
编译错误
无效或不合格的引用全部的代码:
If Check1.Value = 1 And Check2.Value = 1 Then
Dim sql As String
sql = "select Instore.ProId as 产品编号,ProName as 产品名称,Quantity as 数量,Hand as 经手人,InstoreCode as 票号,Instore.Indate as 日期 From Instore Join Product on dbo.Instore.ProId=dbo.Product.ProId where Instore.Indate between '" + Str(DTP1.Value) + "' and '" + Str(DTP2.Value) + "' and " & a & " Like '" + Text1.Text + "+ % +" '"
Debug.Print .RecordSource = sql
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End If
=======================================
Like '" + Text1.Text + " %'"在Debug.Print .RecordSource = sql后面加一句Exit Sub ,运行后,按Ctrl+G弹出立即窗口 ,看看它里面显示的是什么内容......
Debug.Print .RecordSource = sql
Exit Sub
Adodc1.Refresh
......