Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP and SQL Server in One app
Message
De
11/02/2017 13:06:21
 
 
À
10/02/2017 14:37:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01647697
Message ID:
01647854
Vues:
66
>Hi Tore. I was attracted to your suggestion about business classes. I have client/server app that uses SQL Server as a backend but I would like to have it use MySQL or PostgreSQL instead just by changing a few properties. Could you tell me where can I learn to develop such business classes?

cursorAdapter is your friend:
&& pseudo code, untested

procedure application.init()
addproperty(_screen, 'nConnect', Sqlconnect(…))
addproperty(_screen, 'SQLDB', 'mySQL')

procedure myCursorAdapter.Init()

this.dataSource = _screen.nConnect
this.SelectCmd = 'select bla from bla where '
do case
case _screen.SQLDB = 'mySQL'
  this.SelectCmd = this.SelectCmd + {filter condition for mySQL}
case _screen.SQLDB = 'SQLserver'
case _screen.SQLDB = 'postGreSQL'
etc.

procedure form.load() or dataEnvironment

this.addObject('myCursorAdapter', createObject('myCursorAdapter'))
this.myCursorAdapter.cursorFill()
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/
Never explain, never complain (Queen Elizabeth II)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform