这样写
sqlstr='select * from table where id='+''''+str1+''''sqlstr=select * from table where id=''abc'''
或
sqlstr=select * from table where id='+''''+'abc'+''''
sqlstr='select * from table where id='+''''+str1+''''sqlstr=select * from table where id=''abc'''
或
sqlstr=select * from table where id='+''''+'abc'+''''
解决方案 »
- 推荐一个delphi intraweb 的好论坛。
- 请问:SimDesign.NativeXml支持scheme和stylesheet吗?
- 关于ado取数出错的问题
- 请教高手 我的DELPHI系统报SYSTEM.PAS找不到怎么会事
- 图片处理(100分,先给20)
- ◆高分请教:tcpclient 与clientsocket 控件在应用中有什么不同?
- 关于SQL在Access中的查询???
- 新手求 DelphiAPI
- 数据库问题,??
- 如何利用消息机制,将一个应用程序处理的结果(40字节的数据),post给另一应用程序?
- 有谁知道如何在DELPHI中利用代码恢复和备份ORACLE数据库???先谢过了!!!
- 关于dbgrid1的dbRowSelect属性的问题
var
ID: string;
Year: Integer;
begin
S := Format('SELECT * FROM table where Year=%d AND id=''%s''', [Year, ID]);
ShowMessage(S);
end;
Sqltext:='select * from table1 where str = '+chr(39)+Edit1.Text+chr(39);
sqlstr:='select * from table where id='''+'abc'+'''';
query1.sql.add(sqlstr);