Board index » delphi » Dissappearing Table Data

Dissappearing Table Data

My problem is of disappearing data relates to when the application is
suddenly terminated via a terminate process command or a sudden
powerfailure.  The application show the data in the database but apparently
it is not actually written to the disk file for some reason.  I have lost
weeks of data due to this issue any help would be most appreciated.

My application is written with Cuilder 6 using Paradox Table types and the
BDE.  All patches applied as of 3/28/2003 for the above.  The application
uses the following components for the database in question:
TDBGrid, TDBNavigator, TDatasource (x2), TQuery, TTable

The TTable acts as the primary data source link for the first TDatasource.
The first TDatasource supplies and recieves data updates from a the TQuery,
which links to the TDBGrid through the second TDatasource.

Data is posted to the Paradox table via the following code snipette:
ParadoxDatabase->Append();
ParadoxDatabase->FieldByName("Field1")->AsString="Field1Data";
ParadoxDatabase->FieldByName("Field2")->AsBoolean=true;
ParadoxDatabase->FieldByName("Field3")->AsDateTime = StrToDateTime(Now());
ParadoxDatabase->FieldByName("Field4")->Value=false;
ParadoxDatabase->FieldByName("Field5")->AsString="";
ParadoxDatabase->FieldByName("Field6")->AsString="";
ParadoxDatabase->Post();
ParadoxDatabase->Refresh();
ParadoxDatabase->Last();
TQuery->FindLast();

Thank for your help,
Steve

 

Re:Dissappearing Table Data


Quote
"swidmer" <swid...@widmertime.com> wrote:
>My problem is of disappearing data relates to when the application is
>suddenly terminated via a terminate process command or a sudden
>powerfailure.  The application show the data in the database but apparently
>it is not actually written to the disk file for some reason.  I have lost
>weeks of data due to this issue any help would be most appreciated.

> ...

Hi,

You must set the LocalShare BDE Flag to True in order to
disable the BDE Cache. If your Data is Cached and the Pc
goes down you're probably in trouble.

Use the BDE administrator and go to

Configuration | System | Init | Local Share = TRUE

I've never lost any more data after this change.

HTH
Antonio

Re:Dissappearing Table Data


Rick,

Is this done after posting?

Steve

Quote
"Rick Scheibl" <r...@spmfilter.alpha.to> wrote in message

news:3eccf05b$1@newsgroups.borland.com...
Quote
> Hi,

> I've found it necessary to add in the Dataset after post event on
> critical files.

> DbiSaveChanges(table.Handle);

> Rick

> swidmer wrote:
> > My problem is of disappearing data relates to when the application is
> > suddenly terminated via a terminate process command or a sudden
> > powerfailure.  The application show the data in the database but
apparently
> > it is not actually written to the disk file for some reason.  I have
lost
> > weeks of data due to this issue any help would be most appreciated.

> > My application is written with Cuilder 6 using Paradox Table types and
the
> > BDE.  All patches applied as of 3/28/2003 for the above.  The
application
> > uses the following components for the database in question:
> > TDBGrid, TDBNavigator, TDatasource (x2), TQuery, TTable

> > The TTable acts as the primary data source link for the first
TDatasource.
> > The first TDatasource supplies and recieves data updates from a the
TQuery,
> > which links to the TDBGrid through the second TDatasource.

> > Data is posted to the Paradox table via the following code snipette:
> > ParadoxDatabase->Append();
> > ParadoxDatabase->FieldByName("Field1")->AsString="Field1Data";
> > ParadoxDatabase->FieldByName("Field2")->AsBoolean=true;
> > ParadoxDatabase->FieldByName("Field3")->AsDateTime =

StrToDateTime(Now());

- Show quoted text -

Quote
> > ParadoxDatabase->FieldByName("Field4")->Value=false;
> > ParadoxDatabase->FieldByName("Field5")->AsString="";
> > ParadoxDatabase->FieldByName("Field6")->AsString="";
> > ParadoxDatabase->Post();
> > ParadoxDatabase->Refresh();
> > ParadoxDatabase->Last();
> > TQuery->FindLast();

> > Thank for your help,
> > Steve

Re:Dissappearing Table Data


Hi,
Yes it is used After the Post, by calling

DbiSaveChanges(ParadoxDatabase->Handle)

PS: You must include the BDE.HPP in order to use
the DbiSaveChanges

HTH

Quote
"swidmer" <swid...@widmertime.com> wrote in message

news:3ecd379b$1@newsgroups.borland.com...
Quote
> Rick,

> Is this done after posting?

> Steve

> "Rick Scheibl" <r...@spmfilter.alpha.to> wrote in message
> news:3eccf05b$1@newsgroups.borland.com...
> > Hi,

> > I've found it necessary to add in the Dataset after post event on
> > critical files.

> > DbiSaveChanges(table.Handle);

> > Rick

> > swidmer wrote:
> > > My problem is of disappearing data relates to when the application is
> > > suddenly terminated via a terminate process command or a sudden
> > > powerfailure.  The application show the data in the database but
> apparently
> > > it is not actually written to the disk file for some reason.  I have
> lost
> > > weeks of data due to this issue any help would be most appreciated.

> > > My application is written with Cuilder 6 using Paradox Table types and
> the
> > > BDE.  All patches applied as of 3/28/2003 for the above.  The
> application
> > > uses the following components for the database in question:
> > > TDBGrid, TDBNavigator, TDatasource (x2), TQuery, TTable

> > > The TTable acts as the primary data source link for the first
> TDatasource.
> > > The first TDatasource supplies and recieves data updates from a the
> TQuery,
> > > which links to the TDBGrid through the second TDatasource.

> > > Data is posted to the Paradox table via the following code snipette:
> > > ParadoxDatabase->Append();
> > > ParadoxDatabase->FieldByName("Field1")->AsString="Field1Data";
> > > ParadoxDatabase->FieldByName("Field2")->AsBoolean=true;
> > > ParadoxDatabase->FieldByName("Field3")->AsDateTime =
> StrToDateTime(Now());
> > > ParadoxDatabase->FieldByName("Field4")->Value=false;
> > > ParadoxDatabase->FieldByName("Field5")->AsString="";
> > > ParadoxDatabase->FieldByName("Field6")->AsString="";
> > > ParadoxDatabase->Post();
> > > ParadoxDatabase->Refresh();
> > > ParadoxDatabase->Last();
> > > TQuery->FindLast();

> > > Thank for your help,
> > > Steve

Other Threads