![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Feb 2005
Posts: 5
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
You've stored the path in hte string DBFileName - then what do you do with it?
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: Feb 2005
Posts: 5
Rep Power: 0
![]() |
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? |
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
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.
|
|
|
|
|
|
#5 |
|
Newbie
Join Date: Feb 2005
Posts: 5
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#6 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
I will do, if you don't figure it out beforehand. Sorry 'bout that.
|
|
|
|
|
|
#7 |
|
Newbie
Join Date: Feb 2005
Posts: 5
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#8 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
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.
|
|
|
|
|
|
#9 |
|
Newbie
Join Date: Feb 2005
Posts: 5
Rep Power: 0
![]() |
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?
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|