ZReadOnlQuery's refersh vs. Close-Open
Posted: 16.07.2007, 20:38
I have a ReadOnlyQuery with date fields. Some of the fileds are NULL.
When is call Refresh, i get an error message (see below). But when i call Close, and then Open, i don't get the error.
Why is that? What's the difference?
And it stopped here in unit ZDbcMySqlResultSet:
[php]
function TZMySQLResultSet.IsNull(ColumnIndex: Integer): Boolean;
var
Temp: PChar;
begin
{$IFNDEF DISABLE_CHECKING}
CheckClosed;
if FRowHandle = nil then
raise EZSQLException.Create(SRowDataIsNotAvailable);
{$ENDIF}
Temp := FPlainDriver.GetFieldData(FRowHandle, ColumnIndex - 1);
Result := (Temp = nil);
if not Result and (TZAbstractResultSetMetadata(Metadata).
GetColumnType(ColumnIndex) in [stDate, stTimestamp]) then
begin
Result := (AnsiSQLDateToDateTime(Temp) = 0) #<===== stopped here
and (MySQLTimestampToDateTime(Temp) = 0);
end;
end;
[/php]
When is call Refresh, i get an error message (see below). But when i call Close, and then Open, i don't get the error.
Why is that? What's the difference?
And it stopped here in unit ZDbcMySqlResultSet:
[php]
function TZMySQLResultSet.IsNull(ColumnIndex: Integer): Boolean;
var
Temp: PChar;
begin
{$IFNDEF DISABLE_CHECKING}
CheckClosed;
if FRowHandle = nil then
raise EZSQLException.Create(SRowDataIsNotAvailable);
{$ENDIF}
Temp := FPlainDriver.GetFieldData(FRowHandle, ColumnIndex - 1);
Result := (Temp = nil);
if not Result and (TZAbstractResultSetMetadata(Metadata).
GetColumnType(ColumnIndex) in [stDate, stTimestamp]) then
begin
Result := (AnsiSQLDateToDateTime(Temp) = 0) #<===== stopped here
and (MySQLTimestampToDateTime(Temp) = 0);
end;
end;
[/php]