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

Data environment & distributed systems

Status
Not open for further replies.

phita

Programmer
Jun 8, 2001
82
0
0
KE
Hi guys,
Hope you are doing great !

Here's my problem. I have built an application and now I want to deploy it in a network (Windows NT). I want to store the data in the server and put the .EXE on several client machines. Now my problem is, since I used the dataenvironment to place tables in my forms and reports, how will I make it search for data in the server (I have mapped a drive, say G:) while running a the .EXE in the local machine ? I know by default, it searches for data in the drive where the .EXE was started. Note: the mapped drive may vary from machine to machine.

The reason for this is coz I have realized that if I create shortucts to the same .EXE in the server, it becomes very slow as more and more users login into the system. Thus the idea of having .EXE on clients and data on server.

Thanx,

Phita.
 
HI
Method 1:
You can store the data path in your local drive as a mem variable and save it as mem file. In your main prg, when you start the programme, check for the existence of this file and load the datapath value. You can then include this data path in your search path.

Method2:
You can have one data file as a DBF table, having a field for the data path. You can programmatically accept and store the data related to the network path and store this in the table field. Whenever you start the programme.. look for this table, read the field and set your data path.

Hope this helps you.

ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
Normally one would place a shortcut in the menu or on the desktop. This is very easy using winsetup (coming with vfp 7 but also free downloadable from the MS site)
using windows setup you can define the startupdirectory for
any app that's going to be installed on the user's machine.

Also, what you can do is create a method in you application object like opendatabase()

this methodfirst looks in the registry for any values for the 'datapath' property (custom). If that is not the case then use the getfile() for the database and store the justpath() to the datapath property. This is for the first time only.
When closing the application I suggest you write the datapath property to the registry.
Next time the app opens the whole cycle of reading the registry starts again but now there is a value that can be used to open the database (and tables in it).

Good luck

BL
Next ti
 
If you used a DBC you can just open the databse at startup and it will look for every table in the DBC. In this case it only matters where you have stored your database.

HTH,
Weedz (Wietze Veld) They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best. - Steve McConnell
 
Thanx all of you for your great ideas. I will definetely implement them and see which one works best. Keep the spirit up and together we shall conquer !!!

Thanx,

Phita.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top