Access+ADOConnection+ADOQuery
SQL为:select ID,counter_value from counter where ID='C' 运行时有问题:
Project Project1.exe raised exception class EOleException with
message 'From 子句语法错误。'.Process stopped.Use Step or Run to continue.

解决方案 »

  1.   

    直接select ID,counter_value from counter where ID=\'C\'试试
      

  2.   

    select ID,counter_value from [counter] where ID='C'
    正确
      

  3.   

    我也觉得是表名称不对,你看看在ACCESS中能不能查。
      

  4.   

    select ID,counter_value from [counter] where ID='C'
    正确
    ??
    那就这样写
    with adoquery do begin
    Close;
    sql.clear;
    sql.text:='select ID,counter_value from [counter] where ID=:Q';
    parameters.parambyname('Q').value:='c';
    open;
    end;
      

  5.   

    select ID,counter_value from [counter] where ID='C'
    正确?
    counter是access的一个保留字。