日期:2014-05-17 浏览次数:20857 次
var j:string; begin j:='Select JH,SJRQ From SGGZ Where gxsjwc is null And (ysjbz=''Y'' or ysjbz is Null) And cjdwdm='''+edtCJDWDM.Text+''' Order by SJRQ Desc' ; ado.sql.clear; ado.sql.add(j); ado.open(); end; 将下面的SQL在PL/SQL中执行一下,看是不是通过的 Select JH, SJRQ From SGGZ Where gxsjwc is null And (ysjbz = 'Y' or ysjbz is Null) And cjdwdm = 'edtCJDWDM' Order by SJRQ Desc
------解决方案--------------------
"Select JH,SJRQ From SGGZ Where gxsjwc is null And (ysjbz='Y' or ysjbz is Null) And cjdwdm='''+edtCJDWDM.Text+''' Order by SJRQ Desc"
------解决方案--------------------
单引号和双引号都有问题,
"Select JH,SJRQ From SGGZ Where gxsjwc is null And (ysjbz='Y' or ysjbz is Null) And cjdwdm='"+edtCJDWDM.Text+"' Order by JH"
------解决方案--------------------
ysjbz=''Y'' or ysjbz is Null
这个也可以这样
nvl(ysjbz,'Y')='Y'
主要看你报什么错误
------解决方案--------------------
我在delphi看了你的SQL,字符串组成没有问题,
如下:
Select JH,SJRQ From SGGZ Where gxsjwc is null And (ysjbz='Y' or ysjbz is Null) And cjdwdm='aa' Order by JH
可能是你delphi的ADO连接用户权限问题吧,
或者你的adodataset连接问题;
------解决方案--------------------
贴出Delphi代码来
------解决方案--------------------