| View previous topic :: View next topic |
| Author |
Message |
eshipman Guest
|
Posted: Wed Dec 17, 2003 5:16 pm Post subject: Get list of Excel Worksheets with ADO |
|
|
Need to be able to get a list of Worksheets in
an Excel Workbook with ADO.
ADOConnection1.ConnectionString :=
'Provider=MSDASQL.1;Persist ' +
'Security Info=False;Extended ' +
'Properties="DSN=My_Excel_File;' +
'DBQ=MyExcelFile.xls;DefaultDir=C:;' +
'DriverId=790;FIL=excel 8.0;' +
'MaxBufferSize=2048;PageTimeout=5;"';
ADOConnection1.Open;
ADOConnection1.GetTableNames(ExcelWorkBookNames);
Doesn't work...
|
|
| Back to top |
|
 |
Viatcheslav V. Vassiliev Guest
|
Posted: Wed Dec 17, 2003 5:28 pm Post subject: Re: Get list of Excel Worksheets with ADO |
|
|
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:File.xls;Extended
properties=Excel 8.0
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi + ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"eshipman" <eshipman@yahoo!!!.com> ???????/???????? ? ???????? ?????????:
news:MPG.1a4a4b8285b7d376989754 (AT) forums (DOT) borland.com...
| Quote: | Need to be able to get a list of Worksheets in
an Excel Workbook with ADO.
ADOConnection1.ConnectionString :=
'Provider=MSDASQL.1;Persist ' +
'Security Info=False;Extended ' +
'Properties="DSN=My_Excel_File;' +
'DBQ=MyExcelFile.xls;DefaultDir=C:;' +
'DriverId=790;FIL=excel 8.0;' +
'MaxBufferSize=2048;PageTimeout=5;"';
ADOConnection1.Open;
ADOConnection1.GetTableNames(ExcelWorkBookNames);
Doesn't work...
|
|
|
| Back to top |
|
 |
eshipman Guest
|
Posted: Wed Dec 17, 2003 5:39 pm Post subject: Re: Get list of Excel Worksheets with ADO |
|
|
In article <3fe09240 (AT) newsgroups (DOT) borland.com>, [email]support (AT) oledbdirect (DOT) com[/email]
says...
| Quote: | Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:File.xls;Extended
properties=Excel 8.0
"eshipman" <eshipman@yahoo!!!.com> ???????/???????? ? ???????? ?????????:
news:MPG.1a4a4b8285b7d376989754 (AT) forums (DOT) borland.com...
Need to be able to get a list of Worksheets in
an Excel Workbook with ADO.
ADOConnection1.ConnectionString :=
'Provider=MSDASQL.1;Persist ' +
'Security Info=False;Extended ' +
'Properties="DSN=My_Excel_File;' +
'DBQ=MyExcelFile.xls;DefaultDir=C:;' +
'DriverId=790;FIL=excel 8.0;' +
'MaxBufferSize=2048;PageTimeout=5;"';
ADOConnection1.Open;
ADOConnection1.GetTableNames(ExcelWorkBookNames);
Doesn't work...
ADOConnection1.ConnectionString := |
'Provider=Microsoft.Jet.OLEDB.4.0;Persist ' +
'Security Info=False;Extended ' +
'Properties="DSN=My_Excel_File;' +
'DBQ=MyExcelFile.xls;DefaultDir=C:;' +
'DriverId=790;FIL=excel 8.0;' +
'MaxBufferSize=2048;PageTimeout=5;"';
Now, after that change, I get this error:
'Could not find installable ISAM'
|
|
| Back to top |
|
 |
Viatcheslav V. Vassiliev Guest
|
Posted: Wed Dec 17, 2003 7:46 pm Post subject: Re: Get list of Excel Worksheets with ADO |
|
|
No, exactly as I sayd, no DSN, no ODBC:
ADOConnection1.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:File.xls;Extended properties=Excel 8.0';
(without line breaks).
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi + ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"eshipman" <eshipman@yahoo!!!.com> ???????/???????? ? ???????? ?????????:
news:MPG.1a4a50dd9ca0a5c6989755 (AT) forums (DOT) borland.com...
| Quote: | In article <3fe09240 (AT) newsgroups (DOT) borland.com>, [email]support (AT) oledbdirect (DOT) com[/email]
says...
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:File.xls;Extended
properties=Excel 8.0
"eshipman" <eshipman@yahoo!!!.com> ???????/???????? ? ????????
?????????:
news:MPG.1a4a4b8285b7d376989754 (AT) forums (DOT) borland.com...
Need to be able to get a list of Worksheets in
an Excel Workbook with ADO.
ADOConnection1.ConnectionString :=
'Provider=MSDASQL.1;Persist ' +
'Security Info=False;Extended ' +
'Properties="DSN=My_Excel_File;' +
'DBQ=MyExcelFile.xls;DefaultDir=C:;' +
'DriverId=790;FIL=excel 8.0;' +
'MaxBufferSize=2048;PageTimeout=5;"';
ADOConnection1.Open;
ADOConnection1.GetTableNames(ExcelWorkBookNames);
Doesn't work...
ADOConnection1.ConnectionString :=
'Provider=Microsoft.Jet.OLEDB.4.0;Persist ' +
'Security Info=False;Extended ' +
'Properties="DSN=My_Excel_File;' +
'DBQ=MyExcelFile.xls;DefaultDir=C:;' +
'DriverId=790;FIL=excel 8.0;' +
'MaxBufferSize=2048;PageTimeout=5;"';
Now, after that change, I get this error:
'Could not find installable ISAM'
|
|
|
| Back to top |
|
 |
eshipman Guest
|
Posted: Wed Dec 17, 2003 7:51 pm Post subject: Re: Get list of Excel Worksheets with ADO |
|
|
In article <MPG.1a4a4b8285b7d376989754 (AT) forums (DOT) borland.com>,
[email]eshipman@yahoo!!!.com[/email] says...
| Quote: | Need to be able to get a list of Worksheets in
an Excel Workbook with ADO.
ADOConnection1.ConnectionString :=
'Provider=MSDASQL.1;Persist ' +
'Security Info=False;Extended ' +
'Properties="DSN=My_Excel_File;' +
'DBQ=MyExcelFile.xls;DefaultDir=C:;' +
'DriverId=790;FIL=excel 8.0;' +
'MaxBufferSize=2048;PageTimeout=5;"';
ADOConnection1.Open;
ADOConnection1.GetTableNames(ExcelWorkBookNames);
Doesn't work...
|
This works:
ADOConnection1.ConnectionString :=
'Provider=MSDASQL.1;Persist ' +
'Security Info=False;Extended ' +
'Properties="DSN=My_Excel_File;' +
'DBQ=MyExcelFile.xls;DefaultDir=C:;' +
'DriverId=790;FIL=excel 8.0;' +
'MaxBufferSize=2048;PageTimeout=5;"';
ADOConnection1.Open;
ADOConnection1.OpenSchema(siTables, EmptyParam,
EmptyParam, ADODataSet1);
ADODataSet1.DisableControls;
ADODataSet1.Open;
while not ADODataset1.Eof do
begin
ExcelWorkBookNames.Add(ADODataSet1.fields[2].value);
ADODataset1.Next;
end;
ADODataset1.Close;
ADODataSet1.EnableControls;
ADOConnection1.Close;
|
|
| Back to top |
|
 |
|