Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reuse connection name 1

Status
Not open for further replies.

MikeMV

MIS
May 15, 2006
131
US
Hi have a need to create multiple views in sequence and for testing purposes use a different connection than the one that is going to work on real data. I would like to setup the connection name in one place and be able to reuse it by storing it in a variable, but FoxPro does not seem to work that way.

I would like to have a setup such as:

m.link="sysprocompanyu"

and in the code try something like:

REMOTE CONNECTION m.link

Can this be made to work.

Thanks in advace for you feedback.
 
Given that you are creating remote views, the easiest solution would be to create a connection object, which can reside in the same database (DBC) as the views.

Just open the database, and type in the command window:

CREATE CONNECTION SomeName

In the connection design dialogue, enter the parameters for your test connection.

When you want to switch to the live connection, open the same dialogue again and change the parameters. You won't need to make any other changes. Provided you don't change the name of the connection object, everything will work as before, but using the new connection.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top