使用delphi和ms访问时,查询表达式中的语法错误(缺少运算符)

all*_*lxn 2 delphi ms-access

有谁知道这个错误的来源:

项目xxxx.exe引发了异常类EoleException,并在查询表达式中显示消息'语法错误(缺少运算符)'序列号=?'

这是我在带有ms access数据库的delphi中的实际代码.

with AddIndividualsAccountADOQuery do
begin
  SQL.Clear;
  SQL.Add('Select * from IndividualAccount where Serial Number=:Sno');
  Parameters.ParamByName('Sno').Value:=edit1.Text;
  Open;
  Active:= True;
end;
Run Code Online (Sandbox Code Playgroud)

实际代码与delphi和sql数据库运行良好.但是当我使用ms访问时,运行应用程序时会出现上述错误.

Mar*_*ins 7

我相信使用MS-Access你需要在名称周围括号(因为它包含一个空格):

Select * from IndividualAccount where [Serial Number]=:Sno
Run Code Online (Sandbox Code Playgroud)