Delphi中QuotedStr介紹及使用作者:object8888 日期:2010-11-26使用
S:string; qry2.SQL.add('select * from a where b='+s); 出現(xiàn)錯(cuò)誤。 詢問高手之后使用 qry2.SQL.add('select * from a where b='+QuotedStr(s)); 正常。 QuotedStr(s)就是在s兩邊加上單引號(hào)。 quotedstr(edit1.text)直接可以說是在sql查詢分析器里給字符串edit1.text加個(gè)單引號(hào),可以完全拋開delphi的語法.. |
|
|