Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Switch Connection Strings for DBC
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01061696
Message ID:
01062653
Views:
10
Hi Michael i use DBGETPROP as follows. I thnks cursor adapter is also an option
Local lcDBCSQLSTRING,oODBCError as Exception ,lcDBConStr as String 

lcDBCSQLSTRING=This.get_odbc_string()  

TRY 

	If Empty(Dbc())
		Open Database (This.maindbc)
	endif
	
	SET DATABASE TO (this.maindbc )
	
	If !Indbc('DBCCONN', 'CONNECTION')
			Create Connection DBCCONN Connstring  (lcDBCSQLSTRING)
	ELSE
		lcDBConStr=DBGETPROP('DBCCONN', 'CONNECTION','ConnectString')
	

		IF ALLTRIM(lcDBConStr)!=ALLTRIM(lcDBCSQLSTRING)
			=DBSETPROP('DBCCONN', 'CONNECTION','ConnectString',lcDBCSQLSTRING)
	
		ENDIF
		
	Endif




CATCH TO oODBCError
	=MESSAGEBOX(oODBCError.Message) 
ENDTRY
Roses are #FF0000 Violets are #0000FF all my base are belong to you
Previous
Reply
Map
View

Click here to load this message in the networking platform