Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling a *.app and having it use my default data sessio
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00322611
Message ID:
00322966
Views:
21
>< big smirk > Buddy... Pal.... Dear Sweet Mark... Have I mentioned lately how much our friendship means to me? < snickering > Any chance I can peak at that prg?

The Defaults.h has #INCLUDE FOXPRO.H in it as well as all my other defined constants.
#INCLUDE DEFAULTS.H
if !dbused(DATABASE_NAME)
	open data DATABASE_NAME
endif
if type("oApp") = "O"    && even numbered calls to PRG release the objects
	oApp.Release()  && This also releases the Oracle Login Private DS
	oAppParms.Release()
	release oApp, oAppParms
	wait window nowait "Objects released. Environment reset and cleared."
	return
endif
set talk off
public oApp, oAppParms   && in actual APP, these are PRIVATE
oApp      = newobject("Appmgr", ".\Classes\AppManager")
oAppParms = NewObject("SetParams", ".\Classes\AppManager")
oAppParms.Set_Carry       = "OFF"
oAppParms.Set_Century     = "ON"
oAppParms.Set_Confirm     = "OFF"
oAppParms.Set_Database_To = DATABASE_NAME
oAppParms.Set_Deleted     = "ON"
oAppParms.Set_Exact       = "OFF"
oAppParms.Set_Exclusive   = "OFF"
oAppParms.Set_Hours_To    = 24
oAppParms.Set_Multilocks  = "ON"
oAppParms.Set_Near        = "OFF"
oAppParms.Set_Safety      = "OFF"
oAppParms.Set_Seconds     = "ON"
oAppParms.Set_Talk        = "OFF"
oAppParms.Set_Unique      = "OFF"
oApp.App_LoginID = "MMCCASLA"
set database to DATABASE_NAME
oLogin = newobject('Login', '.\Classes\AppManager')
oLogin.mLogin()
*-- mLogin creates a private DS using Session class and connects
*-- to Oracle via a remote view using a shared connection. The
*-- method also adds an oApp.oLoginSession property that stores
*-- an object reference to the Session so it can be released by
*-- oApp when oApp is released.
oLogin.Release()
release oLogin
return
All my forms that use a private DS use the oAppParms.Set_xxxx values in the form's LOAD method. This code is obviously in my form baseclase. So, I just change whatever SET_xxx property before my oApp.DoForm() and set it back to the default after the oApp.DoForm().
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform