Board index » delphi » TTable.Post/ Data structure corruption/ Why?

TTable.Post/ Data structure corruption/ Why?

hi !

There is an error at attempt to execute a PostCloseButtonClick code :
Data structure corruption
But at repeated opening of the form and pressing of the button this
ERROR does not arise ...

WHY ?

Thank You

-----------------------------------------------------------------------------------------------------------

I have placed on the form1 3 buttons and DBEdit1 and other components

buttons: PostCloseButton
              CancelCloseButton
              EditButton
---------------------------------------------- code
-----------------------------------------------------

procedure TForm1.FormActivate(Sender: TObject);
  begin

  DBEdit.Enabled := False;
  PostCloseButtonClick := False;
  ...
  end;

-----------------------------------------------------------------------------------------------------------

procedure TForm1.PostCloseButtonClick(Sender: TObject);
   begin

   if Crossestable.State = dsEdit    then Crossestable.Post;   { error :
Data structure corruption } { at first time }
   if DataBase1.InTransaction    then
DataBase1.Commit;

   Close;
   end;

-----------------------------------------------------------------------------------------------------------

procedure TForm1.CancelCloseButtonClick(Sender: TObject);
   begin

   if Crossestable.State = dsEdit    then Crossestable.Cancel;
   if DataBase1.InTransaction    then DataBase1.Rollback;

   Close;
   end;

-----------------------------------------------------------------------------------------------------------

procedure TForm1.EditButtonClick(Sender: TObject);
   begin

   DataBase1.StartTransaction;
   Crossestable.Edit;

   DBEdit.Enabled := True;
   PostCloseButtonClick := True;

   Close;
   end;

 

Re:TTable.Post/ Data structure corruption/ Why?


Try posting your question again an include the following information. Then
perhaps we can help you.

1. The version of Delphi you are using.
2. The version of the BDE you are using.
3. The database you are using.
4. The code that fails.

--
Bill

(TeamB cannot answer questions received via email.)
(To contact me for any other reason remove nospam from my address)

Re:TTable.Post/ Data structure corruption/ Why?


1. The version of Delphi                  D3
2. The version of the BDE              BDE40
3. The database                              Paradox
4. The code that fails. :                    see the previous question

procedure TForm1.PostCloseButtonClick(Sender: TObject);
   begin

   if Crossestable.State = dsEdit then
        Crossestable.Post;
        { error : Data structure corruption } { at first time }
   if DataBase1.InTransaction    then
        DataBase1.Commit;

   Close;
   end;

Quote
Bill Todd (TeamB) wrote:
> Try posting your question again an include the following information. Then
> perhaps we can help you.

> 1. The version of Delphi you are using.
> 2. The version of the BDE you are using.
> 3. The database you are using.
> 4. The code that fails.

> --
> Bill

> (TeamB cannot answer questions received via email.)
> (To contact me for any other reason remove nospam from my address)

Re:TTable.Post/ Data structure corruption/ Why?


Interesting.  I have many D3 apps using Paradox tables in production at
client sites and have not encountered that. The one thing you are doing that
I have never done is to use transactions on Paradox tables.  Does this occur
on a network?  If so, what kind? Have you rebuilt the table with the table
repair utility?

--
Bill

(TeamB cannot answer questions received via email.)
(To contact me for any other reason remove nospam from my address)

Re:TTable.Post/ Data structure corruption/ Why?


HI

This error "Data structure corruption" occur both on a network and on a local
drive.
But tables look ok after that, there is error message only.
This error began to occur already in several places on TTable.Post

may be i forget include any command in code?

TDatabase.StartTransaction;
TTable.Edit;
...
TTable.Post;   {  |  TTable.Cancel;}
TDatabase.Commit;  {  |  TDatabase.RollBack;}

Andy.

P.S. i'm use Novell IntraNetWare 4.11, Windows NT ws 40, D3, BDE 40 and Paradox
Tables

Quote
Bill Todd (TeamB) wrote:
> Interesting.  I have many D3 apps using Paradox tables in production at
> client sites and have not encountered that. The one thing you are doing that
> I have never done is to use transactions on Paradox tables.  Does this occur
> on a network?  If so, what kind? Have you rebuilt the table with the table
> repair utility?

> --
> Bill

> (TeamB cannot answer questions received via email.)
> (To contact me for any other reason remove nospam from my address)

Re:TTable.Post/ Data structure corruption/ Why?


Another user posted the following suggestions.

Make the following registry entries.

HKEY_LOCAL_MACHINE\Network\Novell\System Config\Netware Dos Requester
 CacheWrites set to No (or Off?) (default is Yes)
 Opportunistic Locking set to No (or Off?) (default is Yes)
 True Commit set to Yes (or On?) (default is No)

--
Bill

(TeamB cannot answer questions received via email.)
(To contact me for any other reason remove nospam from my address)

Other Threads