简体   繁体   中英

Connecting to Excel 2016 with ADOConnection

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 ?

我认为您可以使用我在某些项目中使用过的Jet 4.0,并且效果很好

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM