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!

Dev vs Prod database access

Status
Not open for further replies.

jabhawk

Programmer
Apr 23, 2002
71
0
0
US
I develop my applications in a networked folder where I have a development database. I use this DB for the screens and reports in the DataEnvironment.

When I complile and install the EXE to a production area with its own database the application still opens the development DB instead of the production DB.

I need to know how to force the application to locate the database on the PATH set when the main .prg is run. The development path is stored in the objects to the dev DBC and as long as the path is valid it will use it.

Is there an option, command or utility to force the system to ignore and paths and search for the file on the path? I have been renaming the folder before each compile to prevent the exe from finding it but forgetting it once was enough.

Thoughts?




Jonthan A Black
 
jabhawk

SET DATABASE TO GETFILE("DBC")


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I had the same problem and then found this old thread. Don't know if you still need an answer... but for the others, this I experienced:

INI file holds the path to my DBC and I want to be sure that my DE/cursors will found DBC and to be able to move my EXE and data anywhere.
So I put in DE.BeforeOpenTables:

* read the path info from INI
ini=NEWOBJECT("oldINIreg","registry.vcx")
LocalDBC=''
INI.getinientry(@LocalDBC,'DBC','LocalDBC','.\INI.ini')
* to be sure to have that directory in my path
onlypath=JUSTPATH(lcDBC)
IF AT(onlypath,SET("Path")) > 0
onlypath=set("path")+ iif(empty(set("path")),'',';')+JUSTPATH(lcDBC)
SET PATH TO (onlypath)
endif
* make sure my cursor can find DBC
This.Cursor1.database = (LocalDBC)


And INI.ini:
[DBC]
LocalDBC=C:\anydir\MYDBC.DBC

This way I am in control for location of my DBC. INI file is in my start directory (see ".\" notation). Registry.vcx is standard VFP class.

I hope this will help you or some other guy.

Kruno Malovic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top