problems with tzquery using XE4, mysql 5.1 and zeos 7.1

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
Post Reply
dmegow
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 25.07.2013, 09:55
Location: Deutschland

problems with tzquery using XE4, mysql 5.1 and zeos 7.1

Post by dmegow »

Hi,
compilation worked well with the svn repository, but using the tzquery component the function appendrecord didn't work at all and append + adding data + post works only if, at design time, tzquery.readonly is set to false. If readonly is true at designtime, setting it to false during runtime seems to work and the component returns canmodify=true but it hasn't any effect.
Greetings, D.Megow
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Re: problems with tzquery using XE4, mysql 5.1 and zeos 7.1

Post by mdaems »

If you set the query readonly when it's open that will not have any effect indeed. Did you close the query, set readonly and open again?
Image
dmegow
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 25.07.2013, 09:55
Location: Deutschland

Re: problems with tzquery using XE4, mysql 5.1 and zeos 7.1

Post by dmegow »

Yes, of course...this ist the code to compass the not working appendrecord-function. But there seems to be a more general problem because all kind of changing data (also per edit/post or delete) is impossible if the readonly property was set to true at designtime. (And is possible setting it to false ad design time, even if if you switch it to true and back to false during run time - of course always closing and reopening the query) All this happens both with a libmysql50.dll i used with the same mysql version, an older Zeos 6.. and delphi 2006 and with libmysql51.dll. Sorry, but i will be in a internet-free zone for one week. Afterwords i will look what happens with Zeos 7.1 and Delphi 2006.
Greetings D.Megow

function TForm1.AppendRecord(aQuery: tZQuery; const Values: array of variant): boolean;
var i: integer;
aReadOnly: boolean;
begin
aReadOnly:= aQuery.ReadOnly;
aQuery.Close; aQuery.ReadOnly:= false; aQuery.Open;
aQuery.Append;
for i:= 0 to length(Values)-1 do
begin
if Values<>Null then
aQuery.Fields.AsVariant:= Values;
end;
aQuery.Post;
aQuery.Close; aQuery.ReadOnly:= aReadOnly; aQuery.Open;
end;
Post Reply