Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 15th, 2005, 2:59 PM   #1
ramson
Newbie
 
Join Date: Feb 2005
Posts: 5
Rep Power: 0 ramson is on a distinguished road
program doesn't work on different pc

I come here with the hope of finding an expert who wouldn't mind helping out a newbie
I put a simple application together that uses one file (I've used MS Access and Excel)as its database.It works fine on the pc
it was compiled on but not on other ones.I need to have the database included in the program folder and have the program
know the path of the "new" database and not the "old" one.The problem in VB was resolved by adding:

[b]Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\xxxx.mdb"
End Sub


under form create and it worked. But when I was advised to do this in delphi :

Var
DBFileName: String;
Begin
DBFileName := ExtractFilePath(ParamStr(0)) + 'DatabaseName.mdb';

I did the same thing here and put these lines under FormCreate and changed the "DatabaseName" to my filename,
but that didn't work. Are those two procedures supposed to achieve the same thing?
If they are then I am doing something wrong .. could anyone help me out here and give me a step by step explanation
how I would achieve..I have spent hours upon hours searching the Internet trying to get this done.

Any help would be appreciated.
ramson is offline   Reply With Quote
Old Feb 16th, 2005, 9:07 AM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
You've stored the path in hte string DBFileName - then what do you do with it?
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Feb 16th, 2005, 10:53 AM   #3
ramson
Newbie
 
Join Date: Feb 2005
Posts: 5
Rep Power: 0 ramson is on a distinguished road
This is where I am lost and I need help at a beginner's level. I was advised to:
// Then set the database connection string appropriately
// so that it points to the database file.
// Then set all your table or query components active
I thought I did that when I used the DataSource and ADODataset and I am able to see the tables in the *.mdb file when I run the program on the delphi machine but when I put it on a floppy it keeps looking for the file at the original location. So how do I make the program use this DBFilename as the path to the file?
ramson is offline   Reply With Quote
Old Feb 16th, 2005, 11:05 AM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Unfortunately, I can't remember, and I won't be able to check until I get back to school next week - that's where all my Delphi apps are. I believe it's one of the properties of the ADOConnection though.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Feb 16th, 2005, 11:59 AM   #5
ramson
Newbie
 
Join Date: Feb 2005
Posts: 5
Rep Power: 0 ramson is on a distinguished road
I'll check the properites on the ADOConnection and see what I can come up with. I 'll
definitely post the solution if I find it ..if not though I hope you'll let me know when you get back to school
Thanks again for your help
ramson is offline   Reply With Quote
Old Feb 16th, 2005, 12:29 PM   #6
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I will do, if you don't figure it out beforehand. Sorry 'bout that.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Feb 16th, 2005, 12:37 PM   #7
ramson
Newbie
 
Join Date: Feb 2005
Posts: 5
Rep Power: 0 ramson is on a distinguished road
Problem Solved !!
It's just like you said Ooble...the problem was setting the connection
property for ADODataSet .. before, I used to locate the file showing the whole path..this time I deleted the path and left just the file name and VOILA.!!

Thanks a lot again for the help..I know where to come for help next time and what site to recommend.

Ramson
ramson is offline   Reply With Quote
Old Feb 16th, 2005, 6:40 PM   #8
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Sounds good. Unfortunately, I'm the only guy here (apart from Rory) who knows any Delphi, mainly because it's a crap language. My suggestion is to drop it as soon as you can and move onto C++, C# or Java.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Feb 16th, 2005, 10:03 PM   #9
ramson
Newbie
 
Join Date: Feb 2005
Posts: 5
Rep Power: 0 ramson is on a distinguished road
I am just starting out dabbling with programming and have tried VB as mentioned in the first message. Is Java easier to work with? Any advice on where to start?
ramson is offline   Reply With Quote
Old Feb 17th, 2005, 1:05 PM   #10
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
They're not easier to work with, but if you ever decide to look for a job in programming, that's where the money is.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:09 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC