[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 163
  • Last Modified:

A few db questions...

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
Zoroaster
Asked:
Zoroaster
  • 5
  • 4
  • 3
1 Solution
 
AJFlemingCommented:
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
 
AJFlemingCommented:
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
 
ZifNabCommented:
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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
ZifNabCommented:
OOps flemming, didn't knew you had added some comments... you've must posted them when I was preparing mine. Sorry.
0
 
AJFlemingCommented:
No problems, it took forever to accept the comments anyway, and I got impatient (hence the repeated section)

later,

Adam...
0
 
ZoroasterAuthor Commented:
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
 
ZifNabCommented:
> 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
 
ZoroasterAuthor Commented:
> 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
 
ZifNabCommented:
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
 
ZoroasterAuthor Commented:
Thanks for helping me out a little bit.
0
 
ZifNabCommented:
when problems, just ask.
0
 
ZoroasterAuthor Commented:
OK, thanks, I will do that :-)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now