Bug in generic resolver
Posted: 08.02.2010, 14:53
Zeosdbo with access and ado has problem with autoinc fields (Flagged as
not readonly and writeable).
After patching unit ZDbcResultSetMetadata
.....
function TZAbstractResultSetMetadata.IsReadOnly(Column: Integer): Boolean;
begin
if not Loaded then LoadColumns;
Result := TZColumnInfo(FResultSet.ColumnsInfo[Column - 1]).ReadOnly
//### 08.02.2010 Scheurer autoinc fields are readonly !!!
or TZColumnInfo(FResultSet.ColumnsInfo[Column - 1]).AutoIncrement;
end;
{**
Indicates whether it is possible for a write on the designated column to succeed.
@param column the first column is 1, the second is 2, ...
@return <code>true</code> if so; <code>false</code> otherwise
}
function TZAbstractResultSetMetadata.IsWritable(Column: Integer): Boolean;
begin
if not Loaded then LoadColumns;
Result := TZColumnInfo(FResultSet.ColumnsInfo[Column - 1]).Writable and
//### 08.02.2010 Scheurer readonly and aututoinc fields are not writeable!!!
not TZColumnInfo(FResultSet.ColumnsInfo[Column - 1]).ReadOnly and
not TZColumnInfo(FResultSet.ColumnsInfo[Column - 1]).AutoIncrement
end;
...
everything worked fine.
K.Scheurer
not readonly and writeable).
After patching unit ZDbcResultSetMetadata
.....
function TZAbstractResultSetMetadata.IsReadOnly(Column: Integer): Boolean;
begin
if not Loaded then LoadColumns;
Result := TZColumnInfo(FResultSet.ColumnsInfo[Column - 1]).ReadOnly
//### 08.02.2010 Scheurer autoinc fields are readonly !!!
or TZColumnInfo(FResultSet.ColumnsInfo[Column - 1]).AutoIncrement;
end;
{**
Indicates whether it is possible for a write on the designated column to succeed.
@param column the first column is 1, the second is 2, ...
@return <code>true</code> if so; <code>false</code> otherwise
}
function TZAbstractResultSetMetadata.IsWritable(Column: Integer): Boolean;
begin
if not Loaded then LoadColumns;
Result := TZColumnInfo(FResultSet.ColumnsInfo[Column - 1]).Writable and
//### 08.02.2010 Scheurer readonly and aututoinc fields are not writeable!!!
not TZColumnInfo(FResultSet.ColumnsInfo[Column - 1]).ReadOnly and
not TZColumnInfo(FResultSet.ColumnsInfo[Column - 1]).AutoIncrement
end;
...
everything worked fine.
K.Scheurer