Mirror

Prevent the BDE from loosing information (Views: 100)


Problem/Question/Abstract:

How do I prevent the BDE from loosing information in an application when the PC locks up.

Answer:

Solve 1:

Use the BDE API call DBISavechanges(handle). This will save all data in buffers directly to the database thus preventing a loss of data should anything go wrong in the current database session.

Example

Add BDE to the forms uses clause

procedure TDataform.qryEmployeeAfterPost(DataSet: TDataSet);
begin
  DBISavechanges(qryEmployee.handle);
end;


Solve 2:

unit bdeCommands;
{..
...
..
...}
uses BDE;
{...
... }

function SaveBufferToFile(Dataset: TDataset): Boolean;
begin
  Result := BDESaveChanges(Dataset);
end;

<< Back to main page