注册 登录
编程论坛 Delphi论坛

[求助] 关于delphi访问数据库发生了错误 !!!急!!!急!!!急!!!现在添加了代码

seattle 发布于 2005-05-05 23:20, 896 次点击
project project2.exe raised exception class eoleexception with message '在此上下文中不允许使用'c1999001999001999001999001'。此处只允许使用常量、表达式或变量。不允许使用列名。'.process stopped.use step or run to continue.
     
     while not adoqxiaoban.Eof
     do
     begin
     strxiaoban:=trim(adoqxiaoban.Fields.fieldbyname('areacode').AsString );
     strcodexia=strlinchang+'999'+stryinglinqu+'999'+strzuoyequ+'999'+strlinban+'999'+strxiaoban;
     strcode:=strlinban+strxiaoban;
     adoqs.SQL.Clear ;
     adoqs.SQL.Add('insert into test1 values('+strcodexiao+','+strcode+')');
     adoqs.Prepared ;
     try
     adoqs.Open ;
     adoqxiaoban.Next ;
     except
     showmessage('出错!');
     exit;
     end;
     end;
     adoqlinban.Next ;
     
     这是其中的一段代码 好像出错的就是在这 在adoxiaoban.next那 哪位大虾帮帮忙 很急了
1 回复
#2
空前2005-05-06 19:35
adoqs.Open

改一下:

Adoqs.ExecSQL;
1