在运行程序时说在关键字Load附近有语法错误,我的代码是
 SQLStr:='select * from Load where id='''+Edit1.Text+''' and pwd='''+Edit2.Text+'''' ;
  DM1.ADOQuery1.Close;
  DM1.ADOQuery1.SQL.Clear;
  dm1.ADOQuery1.SQL.Add(sqlstr);
  DM1.ADOQuery1.Open;求指点

解决方案 »

  1.   

    把你的SQL语句放在查询分析器里面执行一下,看报错的具体原因,是参数的问题还是其他的问题
      

  2.   

    SQLStr:='select * from [Load] where [id]='''+Edit1.Text+''' and pwd='''+Edit2.Text+'''';
      

  3.   

    'select * from Load where id='''+Edit1.Text+''' and pwd='''+Edit2.Text+'''' 上述语句没有错,可能是错在“Load”上。你将 Load 改为 [Load] 试一下。
      

  4.   

    load我记得是关键字吧,貌似关键字不可以自己定义,你还用做了表名,把表换个名字看看
      

  5.   

    SQLStr:='select * from [Load] where [id]='''+Edit1.Text+''' and pwd='''+Edit2.Text+'''';试试,应该没有问题了,表名最好不要用关键字
      

  6.   

    在运行程序时说在关键字Load附近有语法错误,我的代码是
      SQLStr:='select * from Load ......已经指出问题了
      

  7.   

    Load在我的程序中使用没有问题。为避免拼接字符串的麻烦,建议使用以下方法,简单好用。
    SQLStr:='select * from Load where id=' + QuotedStr(Edit1.Text) + ' and pwd=' + QuotedStr(Edit2.Text);
      

  8.   

    学习学习先
    继续顶一下
    顶顶帖子高手们
    也请多多赐教
    http://topic.csdn.net/u/20110709/12/3ec63017-cef8-41e0-a524-c9b9dfe56d5c.html
    http://topic.csdn.net/u/20110611/12/3258c959-4f28-46b7-b5d6-46135d73036b.html
    http://topic.csdn.net/u/20110722/14/89f7440b-c4d7-4c9a-a4bb-a503f5135db2.html
    http://topic.csdn.net/u/20110729/10/a7bfaf06-0cf9-4580-8e91-d4e0b92066c6.htmlhttp://topic.csdn.net/u/20110811/16/e56e7cc1-d8c9-40af-92e3-c24ca103d17d.html
    http://topic.csdn.net/u/20110830/13/dfae4ca5-d2b9-4889-8a3c-6f7fb61936c9.html
    http://topic.csdn.net/u/20110831/17/427b6ab0-66c6-4f33-af26-ebd27b0dc541.html
    http://topic.csdn.net/u/20110901/09/83c2c668-cbe6-4db9-966d-bf2f47456811.html
    http://topic.csdn.net/u/20110905/12/a1161adb-8e5d-491a-b302-c9722edf2dab.html
    http://topic.csdn.net/u/20110906/10/86d49517-b7a6-4fae-982b-478d2d6e2a23.html
      

  9.   

    SQLStr:='select * from Load where id='+''''+Edit1.Text+''''+' and pwd='+''''+Edit2.Text+''''; 
    修改原因:SQLStr为组合后的SQL语句,因此组合符合为“''''”和“+”。
      

  10.   

    我也来学习学习,正在学习数据库DELPHI开发。