Session Undefined at TOracleDataset.Next

Equinox

Member²
Hello there,

I've got this strange problem that occassionally this code throws a "session undefined" exception at the Next; statement:
(MyDataSource.DataSet is of type TOracleDataset)

With MyDataSource.DataSet do begin
while not Eof do begin
//Read data and store it in a StringGrid
Next;
end;
end;

I can "workaround" this problem if I avoid the last call to Next; by counting up the processed records and comparing it to the RecordCount member of the dataset. In this case the exception does not occur.

Any ideas why this is happening and how to avoid it properly ?
 
This exception indicates that the Session property of the dataset is set to Nil during the call to "Next". Can you verify this?
 
Back
Top