Solved

A few db questions...

Posted on 1998-07-29
12
148 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now