Question : VFP strategic migration to DBC

Hi Experts

In FPW2.6 time I've created a lot of functions to provide inner database leaks like constraints PK/ FK/ AK / id sequence creations/ and others to check if a table exists before open it and if necessary recreate all the index related to the table.
(a set of tablesreconfigurated when necessary - like an internal dictionary aids this job)

Since it worked out so well I've decided to mantain it when have migrated to VFP.

Referential integrity is provided by DBC, is the id sequence creation too ?

Does it make any sense in mantain the functions I've mentioned mainly for table/ index automatic recreation if it's necessary ?

I know gendbc does a job very correlated but it's not an automatic process, one must trigger it to do the job.

Another doubt: during my process temporary tables are created and the deleted by OS, if I use DBC this temporary tables could be deleted from inside DBC ?

(I know my doubts is a litte out of time)

Thanks in advance !

Answer : VFP strategic migration to DBC

If it works without problems then I would not change it. You should find more important reason to incorporate DBCs into existing application than just the RI or something similar.

Autoincrementing field does not need DBC (it is a part of DBF structure) and DBC does not delete temporary tables - either you or VFP must delete them. I would say DBC is not as useful as it should be... Even the RI must be generated separately as a code by RI builder. The FOREIGN KEY creation does not ensure RI.

So, use DBC when it is necessary, e.g. when you need to create views, when you need long field names, triggers, database events etc.

One thing I don't understand in your question is the sentence "during my process temporary tables are created and the deleted by OS". If you create the temporary table as a cursor then you don't need to delete it because VFP does it for you. Yes, it must be deleted manually after app crash but each VFP application should have some cleanup routine which deletes old temp files in temp folder. OS should not do this work and DBC does not help (but I may be missing something).

Random Solutions  
 
programming4us programming4us