Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connections
Message
 
To
25/10/2004 12:51:48
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00953758
Message ID:
00954938
Views:
11
>>Is there a way to have the connection within the project access the ODBC connection
>>properties. So if the ODBC connection changes the connection in the project would update?

What I would do is create a table (MyDSNs) with 2 fields in it, (THisMachine,DSNString).
Store your StringConnect information in there.
Keep that table on the network somewhere.

In your main program that opens up your database do this:
select myDsns
LOCATE FOR ThisMAchine = SomeName && This could be a variable, property or Method that returns the name that you need
myDSNString = DNSString

** Now you can set the property of the database connection
open Database myDatabase
myConnection = 'My Connection Name in the Database'
DBSETPROP(myConnection,"CONNECTION","CONNECTSTRING",myDSNString)
This way you can have as many dsns as you want and just look for the DSN that you want.
Hope this helps.
What is Wisdom?
Wisdom - The ability to respond to any situation according to God's Plan.
Therefore:
USE Wisdom IN Everything ORDER priority AS Knowledge
SELECT Knowledge
BROWSE FOR Understanding WHERE Wisdom=Guide

LeRoy Jackson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform