Home > Back-end >  Execl do data source
Execl do data source

Time:10-27

 
Execlcon. Connected:=false;
Execlcon. Close;
Execlcon. The ConnectionString:='. The Provider=Microsoft Jet. The OLEDB. 4.0; Data Source='+ OpenDialog1. The FileName +'; Extended Properties="Excel 8.0; HDR=Yes; IMEX=1 "; Persist Security Info=False ';//
Execlcon. Connected:=true;


Note: an error is detected EOleException, invalid and quantity!
Should be Extended Properties="Excel 8.0; HDR=Yes; IMEX=1 ";
This one problem,

I find the Internet for a long time did not find how to define

CodePudding user response:

 
Execlcon. Connected:=false;
Execlcon. The ConnectionString:='. The Provider=Microsoft Jet. The OLEDB. 4.0; Data Source='+ OpenDialog1. FileName +
'; Extended Properties="Excel 8.0; HDR=Yes; IMEX=1 "; Persist Security Info=False ';
Execlcon. Connected:=true;

//remember that file exists

CodePudding user response:

reference 1st floor simonhehe response:
Delphi/Pascal code? 123456 execlcon. Connected:=false; Execlcon. The ConnectionString:='. The Provider=Microsoft Jet. The OLEDB. 4.0; Data Source='+ OpenDialog1. The FileName +'; Extended Properties="Excel 8.0; HDR=...


, of course, I will ensure that file exists, I can try with the path to a file directly, as well as prompt,
So I think that is the -- -- -- -- -- - Extended Properties="Excel 8.0; HDR=Yes; IMEX=1 ";
The problem of point

CodePudding user response:

reference 1st floor simonhehe response:
Delphi/Pascal code? 123456 execlcon. Connected:=false; Execlcon. The ConnectionString:='. The Provider=Microsoft Jet. The OLEDB. 4.0; Data Source='+ OpenDialog1. The FileName +'; Extended Properties="Excel 8.0; HDR=...


Thank you for the eldest brother, is really the problem, I dizzy ~
  • Related