Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP and SQL Server in One app
Message
From
12/02/2017 06:04:13
Thomas Ganss (Online)
Main Trend
Frankfurt, Germany
 
 
To
11/02/2017 13:06:21
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01647697
Message ID:
01647857
Views:
75
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()
>
Previous
Reply
Map
View

Click here to load this message in the networking platform