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
Bug in generic resolver
Moderators: gto, cipto_kh, EgonHugeist, mdaems
I accept that my patch is a little simple minded. But adding the patch
to ado only does not solve the complete problem. Writing to autoinc fields is messy in a multiuser environment (unique identifier of a table record).
I think it is better to add a confiuration flag like "writeableautoinc" to
control if autoincfields allowed to be writeable.
K.Scheurer
to ado only does not solve the complete problem. Writing to autoinc fields is messy in a multiuser environment (unique identifier of a table record).
I think it is better to add a confiuration flag like "writeableautoinc" to
control if autoincfields allowed to be writeable.
K.Scheurer