Solved

A few db questions...

Posted on 1998-07-29
12
146 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
> 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
Comment Utility
> 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
Comment Utility
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
Comment Utility
Thanks for helping me out a little bit.
0
 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
when problems, just ask.
0
 

Author Comment

by:Zoroaster
Comment Utility
OK, thanks, I will do that :-)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

15 Experts available now in Live!

Get 1:1 Help Now