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

DEs in production system Defaults to Data residing in development fold 1

Status
Not open for further replies.

benasumwa

Programmer
Oct 14, 2003
57
KE

Hi Friends,

This is the scenario:

I have a folder containing the source code and
test DBFs/CDXs. (C:\DevFolder)

I have another folder (C:\ProdSys) containing the EXE app
and of course the DBFs/CDXs. Now this folder has real data for production.

The problem is that my app's DEs will always reference
data in the (C:\DevFolder) after compiling the EXE, puting it in (C:\ProdSys) and invoking it from there.

Work-around: I have to keep renaming (C:\DevFolder) to
something else for force the EXE pick the data from (C:\ProdSys). This I do every time I recompile the EXE.

Opening files explicilty in LoadEvent does not rear this
anomaly, only when DEs are used.

Is there something I am missing out?

Any help please?

Thanks all

---------------------------
Benson O. A.
Infinity Link Limited
 

Hi Benson,

This is a familiar problem. However, it's not as all that difficult to solve.

When the form tries to open the tables in the DE, it will first look for the actual paths recorded in the properties of the table objects (that is, the Database or CursorSource properites in the Cursor1, Cursor2, etc. objects in the DE). If it can't find the files there, it will look in the VFP default directory, and then in the search path.

The trick is to make sure that, at run time, the tables don't exist in the original folders (or the folders themselves don't exist). That usually happens anyway, simply because the developer's folders are not visible to the end users. Providing VFP can find the tables in their correct folders, all will be well.

The alternative approach is to tell the form to refrain from opening the folders implicitly, and for you to do it yourself in your code. To achieve that, set the DE's AutoCloseTables and AutoOpenTables to .F. Then, USE the tables in the form's Load event. Make sure the tables are in the default directory or search path (or include the path names in the USE command).

What you don't have to do is to forego using the DE completely. The DE has many benefits. Using either of the above techniques, you'll get those benefits and still be able to open your tables.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 

Mike/Mike

Thanks for such elaborate explanations.
In some cases I don't use DEs and in some
(separate applications) I do. The suggestions
given are highly appreciated. I'll try to
incorporate them in the apps.


Thanks once again


---------------------------
Benson O. A.
Infinity Link Limited
 

Wait a moment!

Hi MikeLewis,

I've learnt something I did not know before.
That I can still have the DE and maintain it's obvious
benefits and also have full control in table opening.

This is great my friend! You deserve a star!

Thanks man!



---------------------------
Benson O. A.
Infinity Link Limited
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top