Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Protecting Paradox tables from corruption

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I'm looking at ways of minimising the risk of potential corruption within Paradox tables (sitting on a server). I've read that it is advisable to use '.Open' and '.Close' accordingly rather than setting the 'Active' property to True or False.
Is this theory correct ? Should I not use the 'Active' property to open and close my tables ?
I've always had the habit of opening the tables on loading the form to make the data available and then closing the table on closing the form to free some resources. I've always made use of the form's 'OnClose' event but again someone has made a point that the ideal situation is to use the 'OnCloseQuery' event to make sure that tables are closed, expecially when you close Windows without closing your application.
Again is this the better way of doing things ?
My aim is to minimise risk of corruption of the Paradox tables on the network.
Any pointers would be appreciated.
Steve
 
hi StevenK,

Well in theory it's better to .Open and .Close table then setting the Active property because wther it's active or not it's open and while it's open it can get "screwed up".

I hope this helps,

BobbaFet Everyone has a right to my opinion.
E-mail me at cwcon@programmer.net
 
I've looked at the code for TTable and TQuery. Calling open sets active := true, calling close sets active := false. I don't see an advantage to calling close and open.

 
If CharlesWright is Right :) (joke.. sorry) then it doesn't matter if you set the active parameter instead of using .open and .close. But as BobbaFet pointed out, it's better to close the database after the query, not only do minimize the threat of corruption, but also you minimize the threat that your program is going to open a Database while it's alreay open.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top