text类型字段检索问题,谢谢

bu2ront 2005-01-05 10:29:39
现有一个表,其中有TEXT字段,如果根据该字段中包含的内容来查找记录,DELPHI怎么实现?
...全文
94 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
bu2ront 2005-01-06
  • 打赏
  • 举报
回复
使用
selectstr:='select * from tablename where substring(fieldname,1,2) like "te"';
Query1.SQL.Clear;
Query1.SQL.Add(selectstr);
Query1.Open;



错误信息:

project project1.exe raised exception class edbengineerror with message 'invalid use of keyword. token:,1,2)line number:1'.process stopped.use step or run to continue.
bu2ront 2005-01-05
  • 打赏
  • 举报
回复
up
under 2005-01-05
  • 打赏
  • 举报
回复
select fieldname from tablename where fieldname like '%text field value%'
under 2005-01-05
  • 打赏
  • 举报
回复
select fieldname from tablename where fieldname like 'text field value'
coeltdit 2005-01-05
  • 打赏
  • 举报
回复
select fieldname from tablename where fieldname = 'text field value'
Kshape 2005-01-05
  • 打赏
  • 举报
回复
就直接用一般的查找不行吗?
类似于nvchar

2,497

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧