Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Portability
Message
From
17/11/1998 14:47:57
 
 
To
17/11/1998 14:46:13
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00158389
Message ID:
00158430
Views:
17
>>>>>>>>>>I'm getting to the point in my app that it's time to push it out of the nest. But I'm having a devil of a time getting it to fly outside my development directory.
>>>>>>>>>>
>>>>>>>>>>Here's what I want to do:
>>>>>>>>>>
>>>>>>>>>>The .exe and some files that I want to stay local are on the local hard drive. The data files can be wherever the user wants them (usually the server). Our clients have multiple operations, and that requires seperate data used by the same exe and the ability to switch between them. So I have it set up so that there are subdirectories off the main data directory. The main data dir just contains some setup files. Each operation will have it's own subdir with it's own database. The databases are all named "tripsoft". In the program, when the user switches operations, I want to set the database to the one in the corresponding directory. If possible, I want to avoid having to change the default dir to that subdir.
>>>>>>>>>>
>>>>>>>>>>The problem is that VFP hardcodes the path to all the data. Even if I do "SET DATABASE TO c:\tripsoft\data\test\tripsoft.dbc", it wants the database to be in my development dir.
>>>>>>>>>>
>>>>>>>>>>I thought I could fix that by going into the .SCX and taking out the path. Now it won't use the database even if I physically change the directory to the subdir. That's no good.
>>>>>>>>>>
>>>>>>>>>>I've noticed that if I cd to the subdir, and it can't find the hardcoded dir, it will use the one in the current dir. But I don't want to change the dir because that'll mess up all my relative paths.
>>>>>>>>>>
>>>>>>>>>>Is there some way to make this work? Or is there a different way of doing it that would work better?
>>>>>>>>>>
>>>>>>>>>>Thanks,
>>>>>>>>>>
>>>>>>>>>>-Michelle
>>>>>>>>>
>>>>>>>>>Firstly, having open few databases with the same name, you take chances to mess your views (if you use some) even if you will reset database properly. Tables can be handled safely, if you programmatically reset all Cursor.Database properties in DataEnvironment.BeforeOpenTables event.
>>>>>>>>
>>>>>>>>Well, there would only be one DB open at a time. I hadn't thought of resetting them programatically. That might be better than messing with the .SCXs.
>>>>>>>>
>>>>>>>>Is this hardcoding problem fixed yet in 6?
>>>>>>>>
>>>>>>>>Thanks,
>>>>>>>>
>>>>>>>>-Michelle
>>>>>>>
>>>>>>>If you keep just one dbc open, then you perfectly safe. 'Hard-coding' problem is actually non-existent as long as you reset Database properties progemmatically.
>>>>>>
>>>>>>Well, I still consider it to be a problem. Having to go into every one of my forms and write a program to modify all of the tables in the DE is not my idea of fun. It would be much easier if VFP just fixed it so they didn't hardcode. I can't imagine that many people run the production version of their software from their development directory.
>>>>>>
>>>>>>Thanks,
>>>>>>
>>>>>>-Michelle
>>>>>
>>>>>Thisform.SetAll("Database",oApp.dbcpathname,"Cursor")
>>>>>It's basically a 'program' you will have to write (or copy over? :).
>>>>
>>>>Cool... I didn't realize you could do that. I actually wasn't sure how to do it, but I thought it would involve modifying the .SCX somehow. Your way is pretty easy. Can I put that in the BEFORE OPEN TABLES method?
>>>>
>>>Yes, if you don't have free tables there (they may complicate the code).
>>
>>The only place I have a free table in a DE is the form where you create the operations, so I just can't put it there.
>>
>>Can you subclass a DE? Then I could just put it in the class.
>>
>I didn't try, but my assumption that VFP can subclass everything.

Then the question is, how do I make forms use my own DE? DE's just seem to come with the form prepackaged. I don't know how to put a different kind there.

Thanks,

-Michelle
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform