Database in Delphi help please

Get help on programming - C++, Java, Delphi, etc.
Post Reply
Millenium
Registered User
Posts: 16
Joined: 16 Feb 2007, 02:00
Contact:

Database in Delphi help please

Post by Millenium »

So i made this awesome media player in delphi , spent allot of hard work on it. But the problem is, After connecting the Database made in Office to the project, (The music's name and filepath ect. is stored here) And copying the files over to another computer, The program looks for the database in MY computers directory instead of attaching the database to the program.

If im still unclear as to what the problem is, someone please reply and ill try to be a bit more specific.


O....and help me please :(
User avatar
rustypup
Registered User
Posts: 8872
Joined: 13 Dec 2004, 02:00
Location: nullus pixius demonica
Contact:

Post by rustypup »

ok. i have zero exp. in delphi, (that's a good thing), but:
1) when you say "created in office", can we assume you're referring to access?
2) if you do mean access, the next assumption is that you're using ADO for the connection and not BDE. are you specifying an absolute path to the database, or are you using an ODBC alias?

the database should be installed relative to your execution directory. because you're using a static string argument to connect, placing your app anywhere outside of the specifed directory structure will present you with this issue.

the options are:
1) use a relative path to access the database in the execution directory tree, ("./data/myDataStore.mdb").
2) use the ODBC tool to create a system alias for your database on the host machine. Regardless of where you install the app, the system will be able to resolve this alias to the correct database.
3) always install in the same directory tree on every host.
4) insert a path alias in the system PATH variable. this will require some effort upfront with the installer and is probably the most brittle. (actually, this one's a horrifically bad idea... )
Most people would sooner die than think; in fact, they do so - Bertrand Russel
Millenium
Registered User
Posts: 16
Joined: 16 Feb 2007, 02:00
Contact:

Post by Millenium »

Hey man thanks for replying :) ill try some of your ideas and get back to you :)

And yes, the database was in acces and i used ADO
If only simplicity was that simple...
Post Reply