Connect to excel 2007 file using ADOConnection in Delphi7
Asked Answered
P

1

5

I want to connect to an excel 2007 file(.xlsx) using delphi 7, so I used a AdoConnection and set its connectionstring property as:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test\qm\Results-summary.xlsx;Extended Properties="Excel 12.0;IMEX=1";Persist Security Info=False

But when I active the AdoConnection i get this error:

Could not find installable ISAM.

Where is the problem?

Plasty answered 23/9, 2013 at 5:42 Comment(0)
P
10

I found the solution. my mistake was using Microsoft.Jet.OLEDB.4.0 driver for excel 2007 file. I changed it to Microsoft.ACE.OLEDB.12.0 driver and set the extended property to Extended Properties="Excel 12.0 Xml;HDR=yes", now my connection string is:

Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=C:\test\qm\Results-summary.xlsx;Mode=Share Deny None;Extended Properties="Excel 12.0 Xml;HDR=yes";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=37;Jet OLEDB:Database Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False;Jet OLEDB:Support Complex Data=False

and it works:)

Plasty answered 23/9, 2013 at 5:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.