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!

Can I change the connection of a remote view?

Status
Not open for further replies.

opticalman

Programmer
Nov 6, 2006
103
US
I am using VFP 8.0 for the front end.
I am using SQL 2005 Express for the back end.
During development I had multiple connections defined. I want to change it to one connection definition, but before removing old connections, I need to redefine the old connections linked to my remote views. I do not see how to change the connection associated with a remote view created via VFP8 visually. Any suggestions?

Jim Rumbaugh
 
Why you use RemoteView when you have CursorAdapter?
(rhetorical question :))
Code:
OPEN YourDataBase
SET DATABASE YourDataBase
DBSETPROP([YourViewName],[VIEW],[Connection],[NewConnectioName])
(not tested, because never used RVs)

Other way is to open the RV with new connection:
Code:
USE YourRV CONNECTION ......

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
Jim,

As far as I know, the only way to do this is to recreate the view. The view does have a connection property, but it is read-only.

Recreating the view isn't too difficult. Just paste the code from the View SQL window into a PRG file. Then wrap a CREATE SQL VIEW command around the SELECT statement. This will let you specify the new connection name. Then execute the PRG.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
I thank you both for timely answers.

Mike, I will try your suggestion.

Bborissov, to answer your rhetorical question, This is my first VFP project. I have used both SPT and remote views and I have found remote views easier to manage and re-use throughout my program. and maybe I'm a little bit lazy [smile]

Jim Rumbaugh

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top