Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Mark Buckley
  
 
 
 Mark Buckley
 Tags
Subject: RE: Can't access vfp database on server
Thread ID: 203295 Message ID: 203625 # Views: 23 # Ratings: 0
Version: Visual FoxPro 7 Category: General VFP Topics
Date: Friday, November 14, 2008 3:34:57 PM         
   


> Thank you very much. Please excuse my newbieness. I am Still confused. I want to set the database path such as "c:\mydata" in config.fpw. In the main prg I want to read that value and assign it to a public variable so that in each form it will set the proper Cursor location. That way, if the database moved I could just edit the config.fpw and away I go. I am not sure what I have to add to config.fpw to do this.
>

You are welcome. In your config.fpw, you can add a line:
path = "c:\mydata"


As for the Public variable: you would not need it, if you'd add a line somewhere early in your "main.prg":
Open yourDatabase Shared


That would work because the DBC would be found because the Data folder is in the search path.
Afterwards, in your form.DataEnvironment code you can use DBC() to determine the path again:

Local lcDataPath
SET DATABASE TO yourDatabase
lcDataPath = JUSTPATH(DBC())
&& your properties-assign code follows


(BTW, you would not necessarily need to reassign dataenvironment properties as long as your dev testdata folder does not exist on the client machine at runtime)


hth
-Stefan



COMPLETE THREAD
Can't access vfp database on server Posted by Mark Buckley @ 11/12/2008 11:43:44 PM
RE: Can't access vfp database on server Posted by Stefan Wuebbe @ 11/12/2008 11:53:09 PM
RE: Can't access vfp database on server Posted by tushar @ 11/13/2008 8:16:32 AM
RE: Can't access vfp database on server Posted by Mark Buckley @ 11/13/2008 5:27:50 PM
RE: Can't access vfp database on server Posted by Benny Thomas @ 11/13/2008 9:01:44 PM
RE: Can't access vfp database on server Posted by Mark Buckley @ 11/13/2008 9:39:13 PM
RE: Can't access vfp database on server Posted by Stefan Wuebbe @ 11/14/2008 6:19:56 AM
RE: Can't access vfp database on server Posted by Mark Buckley @ 11/14/2008 3:22:27 PM
RE: Can't access vfp database on server Posted by Stefan Wuebbe @ 11/14/2008 3:34:57 PM
RE: Can't access vfp database on server Posted by Benny Thomas @ 11/15/2008 5:08:31 PM