buttonclick事件
var
a,s:string;
begin
a:= edit1.text;
adoquery1.close;
adoquery1.sql.clear;
s:= 'select '+a+ 'from jobs';
adoquery1.open;
end;
//为什么我运行的时候说什么找不到存储过程,该怎么修改
我打算把EDIT1。TEXT当变量传进SQL中去
var
a,s:string;
begin
a:= edit1.text;
adoquery1.close;
adoquery1.sql.clear;
s:= 'select '+a+ 'from jobs';
adoquery1.open;
end;
//为什么我运行的时候说什么找不到存储过程,该怎么修改
我打算把EDIT1。TEXT当变量传进SQL中去
begin
if trim().text = '' then Exit;
with adoquery1 do
begin
close;
SQL.Clear;
SQL.Add('select ' + trim().text + ' from jobs');
try
open
except
Application.messageBox('查询错误!','Error',16);
end;
end;
end;其实,你可以跟踪一下,取出你构造的sql语句。然后在explorer里执行一下。就知道错误了。