Page 1 of 1

ZTable(or ZQuery) error

Posted: 12.09.2007, 13:22
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

Posted: 13.09.2007, 15:12
by piper62
Hi Kogata,

what kind of database are you using? Which Operating system and which compiler?
Did you check all connections and settings?

Posted: 14.09.2007, 00:35
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.

Posted: 14.09.2007, 07:41
by mdaems
Do you have more info concerning the EDatabase error? Is there a message from the database server?

Mark

Posted: 14.09.2007, 07:59
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

Posted: 14.09.2007, 12:36
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

Posted: 22.09.2007, 03:03
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