ZTable(or ZQuery) error

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
kgt
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 12.09.2007, 13:11

ZTable(or ZQuery) error

Post by kgt »

Append method have a problem.
In case
ZTable1.Append;
ZTable1.FieldByName('field').AsString := '2a';
Ztable1.Post;

and then EDatabaseError

------------
ZTable1.Insert;
ZTable1.FieldByName('field').AsString := '2a';
Ztable1.Post;
In this case, no problem.

ZQuery have a same proble, too.

Regards

Kogata
piper62
Junior Boarder
Junior Boarder
Posts: 25
Joined: 25.06.2007, 10:40

Post by piper62 »

Hi Kogata,

what kind of database are you using? Which Operating system and which compiler?
Did you check all connections and settings?
kgt
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 12.09.2007, 13:11

Post by kgt »

Hi

This is my enviroment.

OS:WindowsXPSP2
Compiler:Delphi7
Database:SQL Server(MSDE)
ZeosLib:6.6.1beta

When I use ADOconnection & ADODataSet, no problem.
However when I use Zconnection & Ztable, problem occur.

In this case, no problem.
ADODataSet1.Append;
ADODataSet1.FieldByName('field').AsString := '3a';
ADODataSet1.Post;

Regards.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Do you have more info concerning the EDatabase error? Is there a message from the database server?

Mark
kgt
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 12.09.2007, 13:11

Post by kgt »

Hi Mark,

Exception:EDatabaseError
'ZTable1:dataset isn't edit mode or insert mode.'

Code: Select all

-------- ZAbstractRODataset.pas ------
procedure TZAbstractRODataset.SetFieldData(Field: TField; Buffer: Pointer);
var
  ColumnIndex: Integer;
  RowBuffer: PZRowBuffer;
  WasNull: Boolean;
begin
  if not Active then
    raise EZDatabaseError.Create(SOperationIsNotAllowed4);
  if not RequestLive and (Field.FieldKind = fkData) then
    RaiseReadOnlyError;
  if not (State in dsWriteModes) then
    DatabaseError(SNotEditing, Self);   [B]<--- Exception occur[/B]
  if GetActiveBuffer(RowBuffer) then
Regrds

Kogata
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

OK...

This may be a bug. Please make a small project with a 'connect','Append' and 'insert' button. Also include the 'create table' statement necessary to build the sample table. As the error is in the component layer the problem is probably database independent.

Don't forget to post the sample in the bug tracker at http://zeosbugs.firmos.at/ , so we won't forget about your question when it sinks down the forum.

Mark
kgt
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 12.09.2007, 13:11

Post by kgt »

Hi Mark,

I am sorry.
When I maked a simple probject, I found a problem in my code.
I used TMS Grid component in old project.
It was problem.
New simple project was no prblem.
ZeosLib and TMS Grid componet is incompatible.
ADO and TMS Grid Component is compatible.
So I give up using ZeosLib.

Regards,
Kogata
Post Reply