我写select没问题:
SQL.Add('select * from ClientInfo where ID='''+ClientID+
''' and username='''+ClientUser+
''' and password='''+ClientPassword+'''');可如法写insert就不行了:
SQL.Add('insert into LogInfo values ('''+ IntToStr(counter) + ''','''+ClientID+''','''+ ClientIP+ ''',1,'''+ TimeToStr(DateTime)+''')'''');
或
SQL.Add('insert into LogInfo values ('+ IntToStr(counter) + ','+ClientID+','+ ClientIP+ ',1,'+ TimeToStr(DateTime)+')');我该怎么写,能帮我讲将单引号的概念吗?
SQL.Add('select * from ClientInfo where ID='''+ClientID+
''' and username='''+ClientUser+
''' and password='''+ClientPassword+'''');可如法写insert就不行了:
SQL.Add('insert into LogInfo values ('''+ IntToStr(counter) + ''','''+ClientID+''','''+ ClientIP+ ''',1,'''+ TimeToStr(DateTime)+''')'''');
或
SQL.Add('insert into LogInfo values ('+ IntToStr(counter) + ','+ClientID+','+ ClientIP+ ',1,'+ TimeToStr(DateTime)+')');我该怎么写,能帮我讲将单引号的概念吗?
解决方案 »
- 实现等待对话框封装成COM
- 大家好啊,小弟初学delphi,有个疑问,恳请大家给点提示
- 为什么会出现这种错误?
- 一个关于新闻组的笨问题,希望别笑!
- 高分求完整<<Delphi6开发人员指南>>,谁给立即给200分!
- 可用分是怎么赚回来的,我现在已经5个三角了,但可用分没有了,只能每天等10分,只能这样等分吗
- 最近总是进不来,这是我两天以来第一次进来。这是什么问题,什么时候能解决啊?散分!!!
- 编译:DCC32 dsgnintf.pas时提示:undeclare identifier........出错
- Delphi 调用 Win32 API 函数问题
- 老师的作业!编一个游戏
- 如何在delphi中调用windows的写字板、计算器、画图?
- 软件界面开发套餐
showmessage(sql.text);这样看得就比较直观了
這樣好了!
SQL.Text :=
format('Insert into LogInfo values(''%s'',''%s'',''%s'',1,''%s'')',[Inttostr(counter),clientID,ClientIP,TimeToStr(DateTime)]);
SQL.Add('select * from ClientInfo where ID='+''''+ClientID+''''+
'and username='+''''+ClientUser+''''+
'andpassword='+''''+ClientPassword+'''');