起先是delphi7.0+access做的,功能能实现了但是修改ADOquray的连接属性:连接到ORACLE服务器上了后
FORM中的DBGRID也已经显示了基本表的内容,当时一运行程序,
进行操作就提示 ora-00904“无效列名”错误代码如下procedure TForm3.Button1Click(Sender: TObject);
begin
if trim(Edit1.Text)='' then
begin Application.MessageBox('请输入查询参数','注意'); end
else
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.add('select * from book where '+combobox1.text+' like "%'+edit1.text+'%"');
ADOQuery1.ExecSQL;
ADOQuery1.Open;
if ADOQuery1.RecordCount=0 then
begin Application.MessageBox('对不起,查无该书','注意'); end
end;
end;
FORM中的DBGRID也已经显示了基本表的内容,当时一运行程序,
进行操作就提示 ora-00904“无效列名”错误代码如下procedure TForm3.Button1Click(Sender: TObject);
begin
if trim(Edit1.Text)='' then
begin Application.MessageBox('请输入查询参数','注意'); end
else
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.add('select * from book where '+combobox1.text+' like "%'+edit1.text+'%"');
ADOQuery1.ExecSQL;
ADOQuery1.Open;
if ADOQuery1.RecordCount=0 then
begin Application.MessageBox('对不起,查无该书','注意'); end
end;
end;
select * from system.book
另外
like "%'+edit1.text+'%"'
改成为
Like QuotedStr('%'+Edit1.Text+'%')
2:回gong_hui2000(gong_hui2000):改成大写也没有效果
3:回xiaocuo_zrf(刀未锋):你说的那些是没有错,在使用本地的access表的时候就没任
何问题。