Help-Database in a Remote Location: Where to put the data files 
Author Message
 Help-Database in a Remote Location: Where to put the data files

I have written a small database app and want to know if I install it on another
machine, will the app still be looking for the .DB and .DBF files in the
directory structure it was seeking them from at the time of compilation?

For instance, the data files are in C:\DELPHI\WORK\APPLICAT\DATA on my hardrive.

If I install it on another machine, how can I compile the application so that
it will look for the application's data files in the application directory,..
(Wherever that may be..)

Thanks (Please respond with a message to my mailbox as well as the forum)
----
RKR

****************************************

****************************************



Sat, 20 Jun 1998 03:00:00 GMT  
 Help-Database in a Remote Location: Where to put the data files

Quote:
>If I install it on another machine, how can I compile
>the application so that
>it will look for the application's data files in the
>application directory,..
>(Wherever that may be..)

Here's what I do, put a database component somewhere in your project.
 Store the data directory to an ini file.  When the app starts, read
the path from the ini file, then update the database params using
like this

path=<put your string here>

then set all your tables active property to true.  If it is pointing
to the right place, it will work seamlessly.

In addition, I usually create the ini file with whatever installation
procedure I use, so it's right unless someone moves or copies the
files to a different location.

Hope this helps.

Mike



Sun, 21 Jun 1998 03:00:00 GMT  
 Help-Database in a Remote Location: Where to put the data files

Quote:

>I have written a small database app and want to know if I install it on another
>machine, will the app still be looking for the .DB and .DBF files in the
>directory structure it was seeking them from at the time of compilation?

>For instance, the data files are in C:\DELPHI\WORK\APPLICAT\DATA on my hardrive.

>If I install it on another machine, how can I compile the application so that
>it will look for the application's data files in the application directory,..
>(Wherever that may be..)

If you hard coded the path in the database property i.e.
c:\app\data\myTable.db then you will have problems. If, on the other hand,
you created an alias in BDECfg. then you're off to the races. Your
applicaiton will use this alias for all database access. You need only set
the alias in BDECfg for each user.

BTW, make sure you place your tables on a drive with a letter higher than
E: otherwise you will bypass the file locking mechanism and end up with
corrupted tables in multi-user situations.

Ond other thing, be sure to use a TDatabase componet, that way you set the
alias only once for the application.

Michael Lant



Mon, 22 Jun 1998 03:00:00 GMT  
 Help-Database in a Remote Location: Where to put the data files

writes

Quote:
>I have written a small database app and want to know if I install it on another
>machine, will the app still be looking for the .DB and .DBF files in the
>directory structure it was seeking them from at the time of compilation?

>For instance, the data files are in C:\DELPHI\WORK\APPLICAT\DATA on my hardrive.

>If I install it on another machine, how can I compile the application so that
>it will look for the application's data files in the application directory,..
>(Wherever that may be..)

An alternative is to use relative paths, i.e. .\DATA which will mean
that you can set up databases to be 'below' the application in the
appropriate directories. Provided you maintain this when transferring
the completed application all will be well without any changes, either
at design or run time, being required.

--

"Programming is mirroring the world, inside a computer"   Larry O'Brien 1991




Mon, 22 Jun 1998 03:00:00 GMT  
 Help-Database in a Remote Location: Where to put the data files

Quote:

>BTW, make sure you place your tables on a drive with a letter higher than
>E: otherwise you will bypass the file locking mechanism and end up with
>corrupted tables in multi-user situations.

Would you further explain this. Why can't a user USE a shared
directory as drive D: and not have a corrupted table? Is this true
under any Network OS? Or is it a "feature" of DOS's share?

Regards,

================================================

Lohnes and Culver Broadcast Consulting Engineers
8309 Cherry Lane                Laurel, MD 20707
VOICE: 1.410.776.4488        FAX: 1.410.776.4499



Mon, 22 Jun 1998 03:00:00 GMT  
 Help-Database in a Remote Location: Where to put the data files

Quote:

>I have written a small database app and want to know if I install it on another
>machine, will the app still be looking for the .DB and .DBF files in the
>directory structure it was seeking them from at the time of compilation?
>For instance, the data files are in C:\DELPHI\WORK\APPLICAT\DATA on my hardrive.
>If I install it on another machine, how can I compile the application so that
>it will look for the application's data files in the application directory,..

If the data directory is a subdirectory or same as the application
directory, then simply give it a relative name ie "data\file".  Or you
could a registry entry to store the base directory of you application.
---
Bob Mallett
Remember: While the Arc was built by amateurs, it was professionals
          who built the Titanic - Richard Needham M.P.


Mon, 22 Jun 1998 03:00:00 GMT  
 Help-Database in a Remote Location: Where to put the data files

Quote:

> I have written a small database app and want to know if I install it on another
> machine, will the app still be looking for the .DB and .DBF files in the
> directory structure it was seeking them from at the time of compilation?

> For instance, the data files are in C:\DELPHI\WORK\APPLICAT\DATA on my hardrive.

> If I install it on another machine, how can I compile the application so that
> it will look for the application's data files in the application directory,..
> (Wherever that may be..)

> Thanks (Please respond with a message to my mailbox as well as the forum)
> ----
> RKR

> ****************************************

> ****************************************

See ALIAS DEFINITION in DataBase Engine Configuration and set a ALIAS to the
location.

   Carlos Alberto.



Tue, 23 Jun 1998 03:00:00 GMT  
 Help-Database in a Remote Location: Where to put the data files

Quote:


>Subject: Re: Help-Database in a Remote Location: Where to put the data files
>Date: 4 Jan 1996 02:15:18 GMT

>>I have written a small database app and want to know if I install it on another
>>machine, will the app still be looking for the .DB and .DBF files in the
>>directory structure it was seeking them from at the time of compilation?

>>For instance, the data files are in C:\DELPHI\WORK\APPLICAT\DATA on my hardrive.

>>If I install it on another machine, how can I compile the application so that
>>it will look for the application's data files in the application directory,..
>>(Wherever that may be..)
>If you hard coded the path in the database property i.e.
>c:\app\data\myTable.db then you will have problems. If, on the other hand,
>you created an alias in BDECfg. then you're off to the races. Your
>applicaiton will use this alias for all database access. You need only set
>the alias in BDECfg for each user.
>BTW, make sure you place your tables on a drive with a letter higher than
>E: otherwise you will bypass the file locking mechanism and end up with
>corrupted tables in multi-user situations.
>Ond other thing, be sure to use a TDatabase componet, that way you set the
>alias only once for the application.
>Michael Lant

Alternatively you can set the Path= Parameter of the Database component and
avoid the Alias and BDE situation. I let the user set this value and write it
to the Application INI file. Its easier than having them mess with the
BDEConfig.

Cheers,

Matthew



Wed, 24 Jun 1998 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Help on Remote Site Data Forwarding to Central Location

2. Program data file location

3. Putting data in a Database Field

4. How to set database file location

5. Help putting file list into a file

6. DataSnap Remote Data Module using SOAP

7. Question about Remote Data Module

8. Remote data sets and MSSQL 6.5

9. Question about Remote Data Module

10. Adding data files to EXE file - HELP!

11. Remote Data Broker

12. D3, Remote data module & type.lib

 

 
Powered by phpBB® Forum Software