J
jarod2005
Unregistered / Unconfirmed
GUEST, unregistred user!
用ADOConnection控件实现从EXCEL表导入数据到ACCESS表中出现问题:弹出报错,其中一段为:INSERT INTO 语句包含下列未知的字段名:'id',确认键入的字段名是正确的,然后重试.本人确认字段名没问题,不知是哪里出了问题,调试几次都不成功,请高手指点,以下为源代码rocedure TForm1.Button1Click(Sender: TObject);var tmpdir:string;begintryif self.OpenDialog1.Execute thenedit1.Text:=opendialog1.FileName;tmpdir := ExtractFilePath(self.OpenDialog1.FileName) + ExtractFileName(self.OpenDialog1.FileName);self.Caption := tmpdir;self.ADOConnection1.Connected:=true;self.ADOConnection1.Execute('insert into list(id,name) select id,name from [excel 8.0;database=' + tmpdir + '].[Sheet1$]');exceptshowmessage('fail');end;end;end.