Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variable for DBF remote view connection default database
Message
From
04/04/2006 07:45:40
 
 
To
28/03/2006 22:47:02
Joel Hokanson
Services Integration Group
Bellaire, Texas, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01108670
Message ID:
01110212
Views:
15
I've had similar requirements with a common DBC and various SQL server db's and have used the following approach:
* Ive got a Main form with an attached Menu, this code is from one of the menu options procedures.

IF oMainMenuForm.cServerDB = oMainMenuForm.aServerDB(2) OR oMainMenuForm.cServerDB = ''
	oMainMenuForm.cServerDB = oMainMenuForm.aServerDB(1)

	TRY     && Close any open forms
		oMainMenuForm.oInvoices = NULL
	CATCH TO oException
	ENDTRY

	TRY
		oMainMenuForm.oReservations = NULL
	CATCH TO oException
	ENDTRY

	CLOSE TABLES ALL

	IF TYPE('lnSql') = 'N' AND lnSql > 0
		SQLDISCONNECT(0)
		RELEASE lnSql
	ENDIF

	CLOSE DATABASES ALL
	PUBLIC lnSql

	lnSql = SQLCONNECT(oMainMenuForm.aServerDB(1),.T.)
	OPEN DATABASE SOS   && Common DBC wtih remote views

	IF lnSql < 1
		oErrors.ErrorMsg()
	ENDIF
	oMainMenuForm.ACTIVATE
ENDIF
Now you start opening RV's in the form's load event with Use...Connstring lnSql

HTH
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Previous
Reply
Map
View

Click here to load this message in the networking platform