Delphi 7 Connection Strings for Excel 2019 Files
The connection string to load an Excel 2019 file in Delphi 7 would depend on the method being used to access the file. Here are a few examples:/n/n1. Using ADO:/n/n/nProvider=Microsoft.ACE.OLEDB.12.0;Data Source=C:/path/to/file.xlsx;Extended Properties='Excel 12.0 Xml;HDR=YES';/n/n/n2. Using ODBC:/n/n/nDriver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=C:/path/to/file.xlsx;DefaultDir=C:/path/to/;DriverId=1046;MaxBufferSize=2048;PageTimeout=5;/n/n/n3. Using Excel Automation:/n/n/nExcelApp := CreateOleObject('Excel.Application');/nExcelApp.Workbooks.Open('C:/path/to/file.xlsx');/n/n/nNote that in order to use the first two methods, you may need to install the Microsoft Access Database Engine (for ADO) or the Microsoft Excel ODBC driver (for ODBC) on your machine.
原文地址: https://www.cveoy.top/t/topic/kWzq 著作权归作者所有。请勿转载和采集!