您的位置:首页 > 数据库

解决动态生成的SQL中特殊字符的问题 QuotedStr function

2008-12-11 10:42 429 查看
Returns the quoted version of a string.

Unit

SysUtils

Category

String handling routines

Delphi syntax:

function QuotedStr(const S: string): string;

Description

Use QuotedStr to convert the string S to a quoted string. A single quote character (') is inserted at the beginning and end of S, and each single quote character in the string is repeated.

Note: When working with multi-byte character systems (MBCS), use AnsiQuotedStr instead.

Example 

SQL.Add(format(  'select * from tabname where field1 = %s',   [QuotedStr(Edit1.Text)])); 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐