access与delphi标准表达式中数据类型不匹配
ADOQuery1.SQL.Text:='select*fromunitwhereClass='''+UnitClass+'''and(Emap_X-'+inttostr...
ADOQuery1.SQL.Text:='select * from unit where Class='''+UnitClass+''' and (Emap_X-'+inttostr(X)+')*(Emap_X-'+inttostr(X)+')+(Emap_Y-'+inttostr(Y)+')*(Emap_Y-'+inttostr(Y)+')<='+inttostr(R*R);
展开
2个回答
2012-06-27 · 知道合伙人教育行家
关注
展开全部
数据库中如果这字符型数据,在SQL语句加:quotedstr(STRING)
如:mStr:='insert into order (field1,field2,field3,field4) '
+'values('+quotedstr(edit1.text)+quotedstr(edit2.text) +quotedstr(edit3.text)+quotedstr(edit4.text)+')'
还有就是你的:where 后,各个条件,加上括号试下。也就是AND前的条件,加个括号民,AND后的条件,再加个括号
如:mStr:='insert into order (field1,field2,field3,field4) '
+'values('+quotedstr(edit1.text)+quotedstr(edit2.text) +quotedstr(edit3.text)+quotedstr(edit4.text)+')'
还有就是你的:where 后,各个条件,加上括号试下。也就是AND前的条件,加个括号民,AND后的条件,再加个括号
2012-07-02
展开全部
试试这个:
ADOQuery1.SQL.Text:='select * from unit where (Class='''+UnitClass+''' ) and ((Emap_X-'+inttostr(X)+')*(Emap_X-'+inttostr(X)+')+(Emap_Y-'+inttostr(Y)+')*(Emap_Y-'+inttostr(Y)+')<='+inttostr(R*R));
ADOQuery1.SQL.Text:='select * from unit where (Class='''+UnitClass+''' ) and ((Emap_X-'+inttostr(X)+')*(Emap_X-'+inttostr(X)+')+(Emap_Y-'+inttostr(Y)+')*(Emap_Y-'+inttostr(Y)+')<='+inttostr(R*R));
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询