I use TZQuery + TDataSetProvider + TClientDataSet + TZUpdateSql in Delphi 7. I test in MySql 3.23, 4.1 and 5.1 using protocol mysql-4.1 in TZConnection.
The 'real' table structure is: ' IdTab integer, SubIdTab integer, Field1 varchar(50), Field2 varchar(50)'.
The ZQuery.SQL = 'select IdTab, SubIdTab, left(Field1,20) as DescOperation, left(Field2,5) as DescUser from tabelas'
Because the 'real' structure and SQL are different, I adjust the assignment of the fields in ZUpdateSQL.ModifySql.
The insert operation works OK in all Zeos 6.x.
My problem is when I try to alter and post in 'Field1' or 'Field2': works OK only in 6.6.1-beta but in 6.6.2-rc ... 6.6.5-stable, ClientDataset.post produce EDBClient error "trying to modify a read-only field".
I know that this kind of SQL seems to be read-only but I use it in all my systems and it works in 6.6.1-beta
Problem when Post in 6.6.2-rc ... 6.6.5-stable
Moderators: gto, EgonHugeist
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Hi, do you have a very simple test project (+ data creation script) you could post into a bug report at http://zeosbugs.firmos.at ?
Mark
Mark
-
- Fresh Boarder
- Posts: 20
- Joined: 06.11.2007, 22:42
Hallo,
i have the same Problem. But it is only one Query. With other Queries and the same Properties it works.
the Query.ReadOnly is false and the State of the Query is dsEdit.
and here:
is Field.ReadOnly = True
I have updated from 6.6.2 to 6.6.5
Is there a solution ?
Thanks for help.
Edit: I switched back to 6.6.2 rc and now it works. But this is not the solution.
i have the same Problem. But it is only one Query. With other Queries and the same Properties it works.
the Query.ReadOnly is false and the State of the Query is dsEdit.
and here:
Code: Select all
procedure TZAbstractRODataset.SetFieldData(Field: TField; Buffer: Pointer);
var
ColumnIndex: Integer;
RowBuffer: PZRowBuffer;
WasNull: Boolean;
begin
WasNull := False;
if not Active then
raise EZDatabaseError.Create(SOperationIsNotAllowed4);
if not RequestLive and (Field.FieldKind = fkData) then
RaiseReadOnlyError;
// Check for readonly updates
// Lookup values are requeried automatically on edit of all fields.
// Didn't find a way to avoid this...
if Field.ReadOnly and (Field.FieldKind <> fkLookup)
and not (State in [dsSetKey, dsCalcFields, dsFilter, dsBlockRead, dsInternalCalc, dsOpening]) then
DatabaseErrorFmt(SFieldReadOnly, [Field.DisplayName]);
I have updated from 6.6.2 to 6.6.5
Is there a solution ?
Thanks for help.
Edit: I switched back to 6.6.2 rc and now it works. But this is not the solution.
-
- Fresh Boarder
- Posts: 20
- Joined: 06.11.2007, 22:42
-
- Expert Boarder
- Posts: 164
- Joined: 18.03.2008, 13:03
- Contact:
testebelo,
I think what you need is to set Field1.ReadOnly := false; or do you want the fields to become writable once you attach ZUpdateSQL to the query?
haentschman,
you wrote, that Query.ReadOnly is false but did you check the ReadOnly property of the fields of your query? What is your query anyway? Do you use ZUpdateSQL ?
I think what you need is to set Field1.ReadOnly := false; or do you want the fields to become writable once you attach ZUpdateSQL to the query?
haentschman,
you wrote, that Query.ReadOnly is false but did you check the ReadOnly property of the fields of your query? What is your query anyway? Do you use ZUpdateSQL ?
-
- Fresh Boarder
- Posts: 20
- Joined: 06.11.2007, 22:42
Hi,
sorry for the late post
I used at this time a normal query. My Program works before i have updated the Components.
btw: great work
sorry for the late post
I used at this time a normal query. My Program works before i have updated the Components.
Nothing where changed in the Code. And i had the Problem like the first post. All Fields are (i think) not ReadOnly.I have updated from 6.6.2 to 6.6.5
I always work with 6.6.2 ...I switched back to 6.6.2 rc and now it works.
btw: great work
-
- Expert Boarder
- Posts: 164
- Joined: 18.03.2008, 13:03
- Contact:
-
- Fresh Boarder
- Posts: 20
- Joined: 06.11.2007, 22:42