Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Variable for DBF remote view connection default database
Message
De
04/04/2006 07:45:40
 
 
À
28/03/2006 22:47:02
Joel Hokanson
Services Integration Group
Bellaire, Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01108670
Message ID:
01110212
Vues:
14
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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform