L
liu420
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button6Click(Sender: TObject);<br>var<br> filepath,filename:string;<br><br> path2,name2:string;<br>begin<br><br> filepath:=trim(edit1.Text);<br> filename:=trim(edit2.Text); //全文件名<br><br> path2:= ExtractFilePath(filename); // 路径<br> name2:=ExtractFileName(filename); //文件名<br><br> ADOConnection1.ConnectionString :=<br> 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' +<br> filepath + ';Persist Security Info=False';<br> ADOConnection1.Connected := true;<br><br> adoquery1.Close;<br> adoquery1.SQL.Clear;<br> adoquery1.SQL.Text:='insert into aaa select * from [Text;FMT=Delimited;HDR=Yes;DATABASE='+path2(路径)+';].['+name2(文件名)+']';<br> adoquery1.ExecSQL;<br><br><br>上面提示出错信息为 ".....验证失败",哪们高手帮忙看看,是不是这方法不对....