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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database path problem

Status
Not open for further replies.

LindaRichard

Programmer
Feb 23, 2001
103
0
0
CA
I have an application where I set the table (activity) in the data environment of a form I then build a view (tmp_book) from it, and display the view in a grid control by setting the recordsource to tmp_book etc... Under developpemtn mode when the table is located on my C drive everything works fine.

When I compile the program as an exe and include a config.fpw in the start up directory to run a table on the V drive, the grid still wants to display the table from the C drive.

This is the content of my config.fpw
path=v:\isodata\logbook,sys(2023)
SORTWORK=SYS(2023)

When I check with sys(2019) it confirms that its reading the config.fpw on my start up directory (i.e. that has the exe program)

IF I also check with a set("path") it confirms the v drive path.

So I have no idea why it keeps displaying the table content from the C drive.

In addition when I run the exe I get an update conflict error message when I
change rows in the grid. Which doesn't occur when I run it in developpement mode.

I used this approach with other programs. Develop on C(local) and copy the tables to V (server) and set the path using config.fpw.

The program was originally developed in VFP 6.0 and I am now using VFP 7.0.
Does anyone have any suggestions as to why this is not working.

Thanks Linda

 
are you using the data enviroment to open your tables?

if so put your code to open the tables in the load event of the form. Attitude is Everything
 
Linda,
While it may seem logical that those statements would work in your CONFIG.FPW, based on my testing they don't. SYS(2023) isn't expanded, and so it appears that for the PATH it's ignored, and for SORTWORK it may be just using the Windows' default temp directory.

I'd also explicitly set the DEFAULT directory, this is the true critical one for data files - and new files are created here.

Rick
 
The executable will always look for the tables in relation to where it was compliled. compile the exe on c drive the copy it to the destination drive. as long as your data structure is the same as your c drive it will work just fine there.
 
Linda,

When you add anything to a forms dataenvironment the fullpath of the thing your adding gets added in so whereever the Exe goes it will always point to the same thing

See thread184-307909

Basically you need to put some code in the beforeopentables of your DE pointing any Cursorsourec or Database = "tablename" without the fullpath to force VFP to search the path you set in your config.FPW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top