Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP and SQL Server in One app
Message
From
11/02/2017 13:06:21
 
 
To
10/02/2017 14:37:31
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01647697
Message ID:
01647854
Views:
65
>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform