0

I would like to parse a Excel 2016 (xlsx) file from RAD Studio in Delphi language using TADOConnection. I found a similar topic for Excel 2007 (xls) but it seems that it's different in my case.

I'm using the following provider : Microsoft OLE DB Provider for ODBC Drivers

With this connection string :

DSN=Excel Files;DBQ=C:\Users\artiom\Desktop\liste1.xlsx;DefaultDir=C:\;DriverId=790;MaxBufferSize=2048;PageTimeout=5;

Without any users or password.

I'm getting an error when I test the connection :

Connection test failed due to an error while initializing the provider. Unspecified error.

The Excel file is a simple list of articles I would like to insert into a database :

> N°     Name     Price
> 2      Box      20.00
> 34     Screen   120.00

What am I missing ?

VirussInside
  • 187
  • 17
  • Don't you better want to build your connection string by the wizard (accessible when you right click the ADO connection component and select _Edit ConnectionString_ and in the opened dialog click _Build_ button by the _Use Connection String_ edit field)? – Victoria Feb 01 '18 at 10:15
  • I copied the string connection from the wizard. The problem seems to come from the provider imo. I thought it would be easy peasy to connect but I can't figure it out. (I already did it for Access but it uses the Jet 4.0 and works fine) – VirussInside Feb 01 '18 at 12:37

1 Answers1

0

I think you can use the Jet 4.0 I used it in some of my projects and it worked fine

Atrin Noori
  • 311
  • 3
  • 12