Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to be back end RDBMS agnostic?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
How to be back end RDBMS agnostic?
Divers
Thread ID:
00829192
Message ID:
00829192
Vues:
73
This is a really big question: How do you design a VFP program so that it is easy to change what data store it uses?

I'd like to design a new program I'm working on so that it normally uses DBF's, but can be switched to use SqlServer, MSDE or MySql as a back end.

I think many may jump at the quick answer "Use views in a DBC"... but I don't think that's a complete answer:
1) What do you have to do to a view to adjust it from accessing DBF's to accessing MySQL or SqlServer?
2) How do you manage using SQLEXEC for running SQL UPDATE and INSERT commands where, I think, the syntax differs from one DBMS to another?
3) How do you deal with the different Type identifiers in CREATE TABLE commands?
4) How do you generate Primary Keys (VFP6) where VFP must pre-calculate them, and Most RDBMS's have auto-increment fields? (similarly, after adding a new record in an RDBMS, how do you retrieve that auto-generated PK?) A Stored Procedure might simplify things here, even in VFP on an INSERT trigger, but I want to avoid SP's... I want the App to create the DB from scratch (which doesn't necessarily preclude SP's, which it could programmatically create....)


Another "quick answer" many might want to say is "Use business objects"... however, that just avoids the question...: How do you design business objects that handle the above issues?

I'm sure I'll come up with more questions along this line as I work on this... thanks everyone for considering it!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform