K
kingson
Unregistered / Unconfirmed
GUEST, unregistred user!
我用的ado连接方式.
Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data Source=D:/SZJX/MODEL.xls;Mode=Share Deny None;Extended Properties=Excel 8.0;Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDBatabase Password="";Jet OLEDB:Engine Type=35;Jet OLEDBatabase Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDBon't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=true
直接在adoconnect中配置的.
我要实现这样的问题:
当在excel中条件为在dbedit中输入order号时,dbedit2自动填写为excel表中的item字段,如何实现,我写了一下,出错?
procedure TF_edit.DBEdit1Exit(Sender: TObject);
begin
with dm.q_excel do
begin
sql.Clear;
sql.Add('select * from [sheetl$] where order='''+dbedit1.Text+'''');
open;
end;
Dbedit2.Text:=dm.Q_excel.fieldbyname('item').asstring;
end;
end.
这里当执行程序时,老提示where子句有错误,怎么搞呀,大哥们?
Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data Source=D:/SZJX/MODEL.xls;Mode=Share Deny None;Extended Properties=Excel 8.0;Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDBatabase Password="";Jet OLEDB:Engine Type=35;Jet OLEDBatabase Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDBon't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=true
直接在adoconnect中配置的.
我要实现这样的问题:
当在excel中条件为在dbedit中输入order号时,dbedit2自动填写为excel表中的item字段,如何实现,我写了一下,出错?
procedure TF_edit.DBEdit1Exit(Sender: TObject);
begin
with dm.q_excel do
begin
sql.Clear;
sql.Add('select * from [sheetl$] where order='''+dbedit1.Text+'''');
open;
end;
Dbedit2.Text:=dm.Q_excel.fieldbyname('item').asstring;
end;
end.
这里当执行程序时,老提示where子句有错误,怎么搞呀,大哥们?