查车牌的SQL语句

downkey 2003-11-25 04:14:17
ADOQuery1.SQL.Text:='select * from basicdata where cncarnum='''+粤Z.+trim(edit4.text)+港+'''';
我想让用户只输车牌号码中间的字符前后固定的就不用输了,这条SQL报错?
...全文
191 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
lxhong1980 2003-11-25
  • 打赏
  • 举报
回复
ADOQuery1.SQL.Text:='select * from basicdata where cncarnum='+#39+'粤Z.'+trim(edit4.text)+'港'+#39;
ls2008 2003-11-25
  • 打赏
  • 举报
回复
ADOQuery1.SQL.Text:='select * from basicdata where cncarnum='''+'粤Z.'+trim(edit4.text)+'港'+''''
暈倒~~不麻煩嘛
chenylin 2003-11-25
  • 打赏
  • 举报
回复
ADOQuery1.SQL.Text:='select * from basicdata where cncarnum='+QuotedStr('粤Z.'+trim(edit4.text)+'港')
feeling_68 2003-11-25
  • 打赏
  • 举报
回复
ADOQuery1.SQL.Text:='select * from basicdata where cncarnum='''+'粤Z.'+trim(edit4.text)+'港'+''''



ADOQuery1.SQL.Text:='select * from basicdata where cncarnum=QuotedStr('粤Z.'+trim(edit4.text)+'港')'
你再试试看。
thomas_cat 2003-11-25
  • 打赏
  • 举报
回复
用QuotedStr()方便点,多加点很容易晕啊
google1106 2003-11-25
  • 打赏
  • 举报
回复
ADOQuery1.SQL.Text:='select * from basicdata where cncarnum='''+'粤Z.'+trim(edit4.text)+'港'+''''

你少了4处引号
rockswj 2003-11-25
  • 打赏
  • 举报
回复
'select * from basicdata where cncarnum='''+'粤Z.'+trim(edit4.text)+'港'+'''';

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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