当前位置:编程学习 > Delphi >>

delphi 数据库问题!

qstring:='select * from fold join udep on udep.uid=fold.creid where openor=1 and depid='1''; 这句报错,[Error] Unit1.pas(60): Missing operator or semicolon,指针只在1的 右边。 这句查询语句本身没有错误,在数据库中查询了结果select * from fold join udep on udep.uid=fold.creid where openor=1 and depid='1' 是格式上什么问题么?
追问:。。。是delphi啊。。。string是单引号。。。
答案:delphi:
qstring:='select * from fold join udep on udep.uid=fold.creid where openor=1 and depid='+'''1''';
SQL语句字符串中有条件为字符常量时,应该向上面一样,转换后自动变为: 
select * from fold join udep on udep.uid=fold.creid where openor=1 and depid='1'
其他:qstring:="select * from fold join udep on udep.uid=fold.creid where openor=1 and depid='1'"; qstring:='select * from fold join udep on udep.uid=fold.creid where openor=1 and depid=''1''';
后面的应该是双引号。 Hwnd = Plugin.Window.GetKeyFocusWnd()
Delay 2000

t1=now:t2=now:sj1=0.5:sj2=60
Rem abcc
 Delay 20
 If DateDiff("s",t1,now)>=sj1
   
   Delay 10
   
Call Plugin.Bkgnd.KeyPress(Hwnd, 83)
Delay 10   
  t1=now
 End If 
 If DateDiff("s",t2,now)>=sj2
      Delay 10
Call Plugin.Bkgnd.KeyPress(Hwnd, 70)
  t2=now
  End If 
Goto abcc
 

上一个:delphi做登陆界面,有个问题,第一次点确定不行,第二次才会成功,跪求高手指点
下一个:delphi中tactionlist在什么位置?

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,