<i><font color="#663300"><i><font color="#663300">Is it possible to maintain multiple data directories for sister concerns using the same software generated by codebook. Is switching between the different data directories possible by the user, sort of logging of a data dir and logging into another data dir with a different data set
Regards Bhavbhuti</font></i>
Greetings Bhavbhuti,
I may not understand your needs, so please forgive me if I miss the mark. I will share a strategy that I use successfully. It centers on the use of dbpaths.dbf and GetPath().
Modify GetPath() so that if the second parm is logical, i.e. not passed, the field cDb_Local is examined for a value, and if empty, then cDb_Remote is examined for a value. Then you only need to pass the first parm to receive back the fully qualified path to your data.
I have different directories for production and development. The dbpaths in each directory points to a different location, but the "key" is the same in both. Therefore I can do this: lcDataDir= GetPath( 'mydb') and in Production it returns F:..mydbdata and in Development it returns C:..mydbdata
If you are talking about switching data sources while the application is running... You need to have different "key" values in dbpaths and that could make you program coding more difficult to maintain. I'll let you work on that part.
The idea of two directories is really a time saver. When the developer EXE is built and tested, I copy it to production. Production is the "setup" folder for building distributed copies. Test the EXE in production. If tthat works, then run the VFP Setup Wizard and create distribution copies.
You can include multiple copies of dbpaths.dbf for each site supported. Then when they install, they simply delete dbpaths.dbf and rename their location file to dbpaths. They don't need VFP.
HTH </font></i>
Thanks for your help. Actually Im stil new to all this but I guess giving the DirTree may help
SoftWare | +-- DATA19992000 | +-- DATA20002001 etc
The DATA19992000 and DATA20002001 these are differnt data set for different financial years 01/04/2000 to 31/03/2001 in India. The selection between the years I want to do after user Login so I can set user rights to different years of data. Regards Bhavbhuti ©2001 Bhavbhuti Nathwani |