Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP and SQL Server in One app
Message
De
12/02/2017 06:04:13
Thomas Ganss (En ligne)
Main Trend
Frankfurt, Allemagne
 
 
À
11/02/2017 13:06:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01647697
Message ID:
01647857
Vues:
76
Heavily seconding CursorAdapter as base for DB backend exchange option.

As the current app is still in vfp8, I'd recommend upgrading to vfp9, as the vfp9 support in CA base class for typical C/S patterns like timestamp, changed_By fields and so on is cleaner/better. Cost + time of using vfp9 is less than retrofitting vfp8 CursorAdapter on your own, unless you have access to some already tested code (perhaps from a bought framework).

Also thumbs up for adding some behavious specific to the app / app group in own CursorAdapter_Base 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()
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform