Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

A few db questions...

Posted on 1998-07-29
12
151 Views
Last Modified: 2010-04-04
I'm new to this, so be a little patient if I ask stupid questions.

I want to write a database application in Delphi, but there are a few things I want to be sure about.

1. Is it possible to work with components (to access the db) and use at the same time a relative path? This leads to the 2nd question:

2. If I deploy my application on another computer, what do I have to think off? I suppose I have to include my db tables (Paradox) in some directory. Does this have to be the same directory as the .exe file? Do I have to include other files (setting from the BDE, for example)?

I don't thinks this is very difficult stuff for experienced Delphi programmers as you are :-) , but please take your time to explain things carefully (if possible, give me an example).
0
Comment
Question by:Zoroaster
  • 5
  • 4
  • 3
12 Comments
 
LVL 1

Expert Comment

by:AJFleming
ID: 1358970
Delphi will allow you to deal with databases either through aliases (the good way to do things) or using absolute file references. You set up an alias using the Database engine configuration tool to point at the path to your database. Then all the components refer to that alias. This means that your database could be anywhere, so long as the alias knows where it is...
0
 
LVL 1

Expert Comment

by:AJFleming
ID: 1358971
Delphi will allow you to deal with databases either through aliases (the good way to do things) or using absolute file references. You set up an alias using the Database engine configuration tool to point at the path to your database. Then all the components refer to that alias. This means that your database could be anywhere, so long as the alias knows where it is...

Good Luck,

Adam...
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 50 total points
ID: 1358972
Hi zoroaster,

1. What do you mean exactly? You can use alias or just use the path to the files.

2. If you use the standard db- delphi tools (and most others), then you've to distribute the BDE too. Look for redistr.txt on your delphi CD-Rom. You can use several installers for this, which can create the aliases etc automatically on the install computer. Like installshield (also on delphi cd) or http://www.connect.net/jordanr/
  The path to the datafiles doesn't have to be the same as the one of the exe-file. Because, for using the tables, you can say in which directory they are. Or you can give the alias... And when configuring the alias (bde) you can say in which directories the files are.

Zif.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 8

Expert Comment

by:ZifNab
ID: 1358973
OOps flemming, didn't knew you had added some comments... you've must posted them when I was preparing mine. Sorry.
0
 
LVL 1

Expert Comment

by:AJFleming
ID: 1358974
No problems, it took forever to accept the comments anyway, and I got impatient (hence the repeated section)

later,

Adam...
0
 

Author Comment

by:Zoroaster
ID: 1358975
Do I have to use an installation program to move my app from one computer to another?

About aliasses: if I write my application in c:\test\delphi\ and I deploy it to another computer where it is to be stored in c:\program files\MyApp, how can this alias point to the right directory?

In VB I always change the path to the .exe directory (in code) before any action takes place. So I'm always sure to find the right directory. I thought there might be a similar way in Delphi.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1358976
> Do I have to use an installation program to move my app from one computer to another? ! Nope, it makes live easier :-)

>About aliasses: if I write my application in c:\test\delphi\ and I deploy it to another computer where it is to be stored in c:\program files\MyApp, how can this alias point to the right directory? ! Simple, your alias points on your computer to c:\test\delphi. On the other computer you can point the alias to another directory. (When you use aliases, you don't have to change your delphi program...) When using aliases, you've to install the alias on the remote computer too... see BDE administator (or BDE configuration) depending on version of BDE.

> In VB I always change the path to the .exe directory (in code) before any action takes place. So I'm always sure to find the right directory. I thought there might be a similar way in Delphi. ! that's in delphi possible too...

Zif.

0
 

Author Comment

by:Zoroaster
ID: 1358977
> In VB I always change the path to the .exe directory (in code) before any action takes place. So I'm always sure to find the right directory. I thought there might be a similar way in Delphi. ! that's in delphi possible too...

Can you tell me how?
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1358978
Hi,

 with GetDir you get the current directory. Place this one into your tables. Still, alias names are much better!

var

   s : string;
 begin
   GetDir(0,s); { 0 = Current drive }
   MessageDlg('Current drive and directory: ' + s, mtInformation, [mbOk] , 0);
 end;


0
 

Author Comment

by:Zoroaster
ID: 1358979
Thanks for helping me out a little bit.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1358980
when problems, just ask.
0
 

Author Comment

by:Zoroaster
ID: 1358981
OK, thanks, I will do that :-)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi XE10, MySQL Query 4 164
error 1.1 400 Bad request idhttp delphi 18 140
shape, triangle, dbctrlgrid 3 17
Delphi Seattle StructureView color 1 14
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question