首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

数据模糊查询有关问题

2012-03-27 
数据模糊查询问题withdatacalldb.ADOsendlogdobeginclosesql.Clearsql.Add( select*fromTsend_logwherec

数据模糊查询问题
with   datacalldb.ADOsendlog   do
      begin
      close;
      sql.Clear;
      sql.Add( 'select   *   from   Tsend_log   where   context   like   ' '% '+quotedstr(memo1.Text   )+ '% ');
      open;
        while   not   eof   do
        begin
        ..........
SQL语句有问题,一运行就提示在memo1.text输入的内容格式错误,同引号也试过这样也不行,但编译没有问题,可以通过。
sql.Add( 'select   *   from   Tsend_log   where   context   like   ' '% '+quotedstr(memo1.Text   )+ '% ' ' ');

[解决办法]
' '% '+quotedstr(memo1.Text )+ '% ');-> '+quotedstr( '% ' + memo1.Text + '% ');试一下

热点排行