Problem when Post in 6.6.2-rc ... 6.6.5-stable

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

Post Reply
testebelo
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: 13.08.2009, 00:25

Problem when Post in 6.6.2-rc ... 6.6.5-stable

Post by testebelo »

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
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

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
Image
haentschman
Fresh Boarder
Fresh Boarder
Posts: 20
Joined: 06.11.2007, 22:42

Post by haentschman »

Hallo,

i have the same Problem. But it is only one Query. With other Queries and the same Properties it works. :gruebel:

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]);
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.
haentschman
Fresh Boarder
Fresh Boarder
Posts: 20
Joined: 06.11.2007, 22:42

Post by haentschman »

Hi all...

is this Problem fixed in 6.6.6 ?
Wild_Pointer
Expert Boarder
Expert Boarder
Posts: 164
Joined: 18.03.2008, 13:03
Contact:

Post by Wild_Pointer »

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 ?
haentschman
Fresh Boarder
Fresh Boarder
Posts: 20
Joined: 06.11.2007, 22:42

Post by haentschman »

Hi,
sorry for the late post :oops:

I used at this time a normal query. My Program works before i have updated the Components.
I have updated from 6.6.2 to 6.6.5
Nothing where changed in the Code. And i had the Problem like the first post. All Fields are (i think) not ReadOnly.
I switched back to 6.6.2 rc and now it works.
I always work with 6.6.2 ... :(

btw: great work 8)
Wild_Pointer
Expert Boarder
Expert Boarder
Posts: 164
Joined: 18.03.2008, 13:03
Contact:

Post by Wild_Pointer »

Hello haentschman,

Can you provide the table create script and the SQL query you use in TZQuery?
haentschman
Fresh Boarder
Fresh Boarder
Posts: 20
Joined: 06.11.2007, 22:42

Post by haentschman »

Hi,
:roll: that´s not easy... I dont know the Table and the SQL. The bugreport i have deleted :oops:

I try to make a Sample. I need some days...

have a nice day...
Post Reply