Eof: Boolean;
The Eof property returns True if the cursor in the data source is on the last record.
Executing the example requires the Data.xls file in the disk C root directory.
Sub Main;
Var
ExcelProvider: IDtExcelProvider;
v: Array;
i: Integer;
Begin
ExcelProvider := New DtExcelProvider.Create;
ExcelProvider.File := "c:\Data.xls";
ExcelProvider.DriverVersion := "Excel 8.0";
ExcelProvider.Query := quot;Select * From [Sheet1$]quot;;
ExcelProvider.HasHeader := False;
ExcelProvider.Open;
While Not ExcelProvider.Eof Do
ExcelProvider.Fetch(v);
For i := 0 To v.Length - 1 Do
Debug.Write(v[i] + " ");
End For;
Debug.WriteLine("");
End While;
ExcelProvider.Close;
End Sub Main;
After executing the example a new data provider, that imports data from Excel file, is created. Values of all entries are read from the file, the first row is not regarded as the row that contains field names. Obtained values are displayed in the development environment console.
See also: