Data Environment and Data Source 
Author Message
 Data Environment and Data Source

I have an application (VFP6) which is working fine.
The problem is that the customer wants to keep the data in a different
directory than the one I designed.
i.e instead of keeping the database and the tables in the root directory he
wants it in the "data" directory.
This involves changing many forms, as the data environment is set to the
database and tables which are in the root directory.

I am ready to do this change, but I wonder what is the best way around it,
because in 2001 he will ask for a new directory.
Is there a way to keep the data in parameterized location without having to
change the data environment all the time, or maybe in this case I can't make
use of the data environment?

Thank you

Jonathan Feldman



Sun, 27 Apr 2003 03:00:00 GMT  
 Data Environment and Data Source

Jonathan,

FoxPro just needs to find the data folder along the search path.
So, it can be anywhere, as long as you have a SET PATH statement.
One way could be having a config.fpw file in the app's root directory with a
line
    path=c:\whatever\data
or if \Data is a subfolder of the application's path
    path=data
Many apps don't need more than one path.

hth
-Stefan



Quote:
> I have an application (VFP6) which is working fine.
> The problem is that the customer wants to keep the data in a different
> directory than the one I designed.
> i.e instead of keeping the database and the tables in the root directory
he
> wants it in the "data" directory.
> This involves changing many forms, as the data environment is set to the
> database and tables which are in the root directory.

> I am ready to do this change, but I wonder what is the best way around it,
> because in 2001 he will ask for a new directory.
> Is there a way to keep the data in parameterized location without having
to
> change the data environment all the time, or maybe in this case I can't
make
> use of the data environment?

> Thank you

> Jonathan Feldman



Sun, 27 Apr 2003 03:00:00 GMT  
 Data Environment and Data Source
All you need to do is make sure that SET PATH TO points to the data files
unless, of course, you hard-coded the path in your application.

The path can also be set in the CONFIG.FPW file like this:

PATH=<path to data>

which is even better because then you point to test data while testing and
to the real data after testing without changing the application.


Quote:
> I have an application (VFP6) which is working fine.
> The problem is that the customer wants to keep the data in a different
> directory than the one I designed.
> i.e instead of keeping the database and the tables in the root directory
he
> wants it in the "data" directory.
> This involves changing many forms, as the data environment is set to the
> database and tables which are in the root directory.

> I am ready to do this change, but I wonder what is the best way around it,
> because in 2001 he will ask for a new directory.
> Is there a way to keep the data in parameterized location without having
to
> change the data environment all the time, or maybe in this case I can't
make
> use of the data environment?

> Thank you

> Jonathan Feldman



Sun, 27 Apr 2003 03:00:00 GMT  
 Data Environment and Data Source

Or you can save the pad in a file as follows:
To store the pad in the file=  storepath.var
procedure storepath
mypathdata="c:\myapp\mydata"
mypathapp="c:\myapp\source"
save to "storepath.mem" all like mypath     &&this is saving all the var
like mypath* in the file storepath.mem
return

procedure getpath
restore form "storepath.mem" additive        &&now the app will create these
var.
return

--
Roelstraete Jimmy
Belgium Foxpro programmer

Quote:
> I have an application (VFP6) which is working fine.
> The problem is that the customer wants to keep the data in a different
> directory than the one I designed.
> i.e instead of keeping the database and the tables in the root directory
he
> wants it in the "data" directory.
> This involves changing many forms, as the data environment is set to the
> database and tables which are in the root directory.

> I am ready to do this change, but I wonder what is the best way around it,
> because in 2001 he will ask for a new directory.
> Is there a way to keep the data in parameterized location without having
to
> change the data environment all the time, or maybe in this case I can't
make
> use of the data environment?

> Thank you

> Jonathan Feldman



Sun, 27 Apr 2003 03:00:00 GMT  
 Data Environment and Data Source

Quote:

> I have an application (VFP6) which is working fine.
> The problem is that the customer wants to keep the data in a different
> directory than the one I designed.
> i.e instead of keeping the database and the tables in the root directory he
> wants it in the "data" directory.
> This involves changing many forms, as the data environment is set to the
> database and tables which are in the root directory.

> I am ready to do this change, but I wonder what is the best way around it,
> because in 2001 he will ask for a new directory.
> Is there a way to keep the data in parameterized location without having to
> change the data environment all the time, or maybe in this case I can't make
> use of the data environment?

> Thank you

> Jonathan Feldman

As others have pointed out, as long as the desired database is the
only one that VFP is able to find in its path at runtime, you'll
probably be fine.

Usually this works well enough, however, I have had situations where
VFP did not like that the database was not located where the cursors
in the form DEs said it was.  To be honest with you, it has been so
long since I worked around this, I can't remember the errors that
VFP was kicking out.

Anyway, the solution was to programmatically change the Database
properties of all the cursors in the DE to the location of the
desired database at runtime.  There was a recent thread on this
where I described in detail how to do this.  Go to www.deja.com
and search for "lademembers" as a keyword.

-- TRW
_______________________________________
My e-mail:  t r w 7

_______________________________________



Sun, 27 Apr 2003 03:00:00 GMT  
 Data Environment and Data Source
So what am I supposed to keep in the DE?
I always thought that the whole idea of the DE is to save you the hassle of
opening and closing tables.

by the way: in the help for SET PATH it's defined "Specifies a path for file
searches."
If I need to scan the table, there is still the hassle of opening and
closing the file.


Quote:

> Jonathan,

> FoxPro just needs to find the data folder along the search path.
> So, it can be anywhere, as long as you have a SET PATH statement.
> One way could be having a config.fpw file in the app's root directory with
a
> line
>     path=c:\whatever\data
> or if \Data is a subfolder of the application's path
>     path=data
> Many apps don't need more than one path.

> hth
> -Stefan



> > I have an application (VFP6) which is working fine.
> > The problem is that the customer wants to keep the data in a different
> > directory than the one I designed.
> > i.e instead of keeping the database and the tables in the root directory
> he
> > wants it in the "data" directory.
> > This involves changing many forms, as the data environment is set to the
> > database and tables which are in the root directory.

> > I am ready to do this change, but I wonder what is the best way around
it,
> > because in 2001 he will ask for a new directory.
> > Is there a way to keep the data in parameterized location without having
> to
> > change the data environment all the time, or maybe in this case I can't
> make
> > use of the data environment?

> > Thank you

> > Jonathan Feldman



Sun, 27 Apr 2003 03:00:00 GMT  
 Data Environment and Data Source



Quote:
> So what am I supposed to keep in the DE?

Keep the DE as it is. As long as the database container and it's member
tables are all in the same folder, it can be moved wherever you want. Just
change the PATH setting accordingly at runtime, FoxPro won't care for the
path written into the .Cursor.Database property at design time.
And as long as there is only one data folder along the search path, ie. keep
any dev-data folders outside.

Quote:
> I always thought that the whole idea of the DE is to save you the hassle
of
> opening and closing tables.

That's right and untouched.

Quote:
> by the way: in the help for SET PATH it's defined "Specifies a path for
file
> searches."
> If I need to scan the table, there is still the hassle of opening and
> closing the file.

Same as above. As an example create some folder, maybe d:\test\ and copy the
entire database into it. Then type
    close databases all
    set path to
into the command window. Assumed you have a table d:\test\customer.dbf
    use customer    &&will give an error
but
    set path to d:\test
    use customer    &&will work
without any paths needed for the USE command.

Ok, on the other hand there is Tim's warning in his message below, but I
didn't experience nothing like that yet.

-Stefan

Quote:


> > Jonathan,

> > FoxPro just needs to find the data folder along the search path.
> > So, it can be anywhere, as long as you have a SET PATH statement.
> > One way could be having a config.fpw file in the app's root directory
with
> a
> > line
> >     path=c:\whatever\data
> > or if \Data is a subfolder of the application's path
> >     path=data
> > Many apps don't need more than one path.

> > hth
> > -Stefan



> > > I have an application (VFP6) which is working fine.
> > > The problem is that the customer wants to keep the data in a different
> > > directory than the one I designed.
> > > i.e instead of keeping the database and the tables in the root
directory
> > he
> > > wants it in the "data" directory.
> > > This involves changing many forms, as the data environment is set to
the
> > > database and tables which are in the root directory.

> > > I am ready to do this change, but I wonder what is the best way around
> it,
> > > because in 2001 he will ask for a new directory.
> > > Is there a way to keep the data in parameterized location without
having
> > to
> > > change the data environment all the time, or maybe in this case I
can't
> > make
> > > use of the data environment?

> > > Thank you

> > > Jonathan Feldman



Sun, 27 Apr 2003 03:00:00 GMT  
 Data Environment and Data Source

Quote:

> The problem is that the customer wants to keep the data in a different
> directory than the one I designed.
> i.e instead of keeping the database and the tables in the root directory he
> wants it in the "data" directory.
> This involves changing many fo"Z49W=8Sthe data environment is set to the
> database and tables which are in the root directory.

> I am ready to do this change, but I wonder what is the best way around it,
> because in 2001 he will ask for a new directory.
> Is there a way to keep the data in parameterized location without having to
> change the data environment all the time, or maybe in this case I can't make
> use of the data environment?

> Thank you

> Jonathan Feldman


only one that VFP is able to find in its path at runtime, you'll
probably be fine.

Usually this works well enough, however, I have had situations where
VFP did not like that the database was not located where the cursors
in the form DEs said it was.  To be honest with you, it h2DQ7#6$7so
long since I worked around this, I can't remember the errors that
VFP was kicking out.

Anyway, the solution was to programmatically change the Database
properties of all the cursors in the DE to the location of the
desired database at runtime.  There was a recent thread on this
where I described in d/CR<:$XPw to do this.  Go to www.deja.com
and search for "lademembers" as a keyword.

-- TRW
_______________________________________
My e-mail:  t r w 7

_______________________________________



Sun, 27 Apr 2003 03:00:00 GMT  
 Data Environment and Data Source
On Wed, 8 Nov 2000 17:09:53 +0100, "Jimmy Roelstraete"

Quote:

>--
>Roelstraete Jimmy
>Belgium Foxpro programmer

Suddenly i felt less lonely <s>

JML

Jean-Marie Laeremans (Belgique) - FE AVP&Cie
Dpartement Belge, Bruges



Mon, 28 Apr 2003 03:00:00 GMT  
 Data Environment and Data Source
Why aren't you in Frankfurt?
-Anders


Quote:
> On Wed, 8 Nov 2000 17:09:53 +0100, "Jimmy Roelstraete"

> >--
> >Roelstraete Jimmy
> >Belgium Foxpro programmer

> Suddenly i felt less lonely <s>

> JML

> Jean-Marie Laeremans (Belgique) - FE AVP&Cie
> Dpartement Belge, Bruges



Mon, 28 Apr 2003 03:00:00 GMT  
 Data Environment and Data Source


Quote:
>Why aren't you in Frankfurt?
>-Anders

Well i considered it. Went even so far as to request the info (looked
rather interesting) but the date was awkward for me (work related) .
Maybe next year.

JML

Jean-Marie Laeremans (Belgique) - FE AVP&Cie
Dpartement Belge, Bruges



Tue, 29 Apr 2003 03:00:00 GMT  
 Data Environment and Data Source
Hope to see you there. I couldn't go this year either.
-Anders


Quote:


> >Why aren't you in Frankfurt?
> >-Anders

> Well i considered it. Went even so far as to request the info (looked
> rather interesting) but the date was awkward for me (work related) .
> Maybe next year.

> JML

> Jean-Marie Laeremans (Belgique) - FE AVP&Cie
> Dpartement Belge, Bruges



Wed, 30 Apr 2003 10:33:20 GMT  
 Data Environment and Data Source
On Sat, 11 Nov 2000 03:33:20 +0100, "Anders Altberg"

Quote:

>Hope to see you there. I couldn't go this year either.
>-Anders

Definitely. I'll arrange my work schedule next year to fit it in. Too
good an opportunity to let it fly. After all Franfurt is only a few
hundred miles from my home.

JML

Jean-Marie Laeremans (Belgique) - FE AVP&Cie
Dpartement Belge, Bruges



Wed, 30 Apr 2003 03:00:00 GMT  
 Data Environment and Data Source

We'll have to remind each other of these promises when the time comes.
-Anders


  Hey JML,
  I'll try to go there too, i swear...<g>

  Fred

  Jean-Marie Laeremans a crit :

    On Sat, 11 Nov 2000 03:33:20 +0100, "Anders Altberg"

    >Hope to see you there. I couldn't go this year either.
    >-Anders
    >
    Definitely. I'll arrange my work schedule next year to fit it in. Too
    good an opportunity to let it fly. After all Franfurt is only a few
    hundred miles from my home.

    JML

    Jean-Marie Laeremans (Belgique) - FE AVP&Cie
    Dpartement Belge, Bruges

  --
  FE AVP&Cie
  Juillenay, Europe



Thu, 01 May 2003 03:00:00 GMT  
 Data Environment and Data Source
On Sun, 12 Nov 2000 16:51:15 +0100, Fred - Armoni

Quote:

>Hey JML,
>I'll try to go there too, i swear...<g>

Now we've only have to persuade Shar.....<VBG>

Jean-Marie

Jean-Marie Laeremans (Belgique) - FE AVP&Cie
Dpartement Belge, Bruges



Fri, 02 May 2003 03:00:00 GMT  
 
 [ 16 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Adding a Data source to the Open Data Source Window in MS Word

2. VFP5 - Data Environment - cursor source

3. VFP 5.0 Form,Data Environment, Data Session

4. Data Environment/Data Session

5. Word 2002 Error Message: Unable to Open Data Source using Visual FoxPro Data Base File

6. Data Environment keeps losing tables

7. Data Environment

8. VFP, Reports, Data Environment and Cursors - Help!

9. Views in data environment

10. Data environment control

11. Advice on data environments needed

12. manupulating the data environment

 

 
Powered by phpBB® Forum Software