I'm using ADOdataset component to view an Excel Spreadsheet on a Delphi form.
The component requires that the CommandText property be set to the name of a spreadsheet in the workbook being opened.
How can I set this property to open the first spreadsheet in the workbook regardless of the name?
procedure TForm1.BitBtn1Click(Sender: TObject);
var XLSFile, CStr : string;
begin
if OpenDialog1.Execute() then
begin
XLSFile := OpenDialog1.FileName;
CStr := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='
+XLSFile+'; Extended Properties=Excel 8.0;Persist Security Info=False';
ADODataSet1.Active := False;
ADODataSet1.ConnectionString := Cstr;
ADODataSet1.CommandText := ??????????;
ADODataSet1.Active := True;
end;
end;