Click to See Complete Forum and Search --> : setting path of my applications database
rinoa_fftsy
Aug 7th, 2006, 04:26 AM
i have a VB program that access a microsoft access database dbcourse.mdb in this path c:\course\dbcourse.mdb..all the bound countrols access this database in this path set in its connection string.
e.g.
adodc control
connectionstring=c:\course\dbcourse.mdb.
my problem is, actually its more of an inquiry than a problem..
if i install the system to another computer, should i really need to copy manually the course folder containing the dbcourse.mdb file to drive c? or there is another way of automatically installing this with the exe file?
i really wish i can deploy the program by just a click of setup.exe and all the needed files like *.mdb will be all in its place.
how should i do it?
thanks in advance for your help... :)
randem
Aug 7th, 2006, 05:15 AM
You can create an installation package and include the database and it will be installed also. The problem youre going to have is that the path that you specified will not be on the target computer so your application will fail. You need to dynamically set the datasource to the app.path.
Using bound controls is evil... You should learn about ADO and a DSN-Less connection so that you can operate more smoothly.
RhinoBull
Aug 7th, 2006, 07:37 PM
... The problem youre going to have is that the path that you specified will not be on the target computer so your application will fail. You need to dynamically set the datasource to the app.path...
Not necessary - you may specify any folder you wish and when it is deployed folder will be created (if it isn't there yet).
Different utilities requires different implementation procedure.
randem
Aug 7th, 2006, 09:44 PM
Of course not necessarily....
Try installing it on a network drive or just the D: drive or any drive other than c:
Once the path is hardcoded your option are very limited.
??????????
RhinoBull
Aug 8th, 2006, 12:41 PM
First, you shouldn't be installing on any media type drives.
And second, as long as you have admin ot at least "read/write" permissions you may install it anywhere within your network.
And there isn't any "hardcoded path" (except for the destination folder name if any at all) - any path is dynamic and depends on the value specified when application was packaged.
randem
Aug 8th, 2006, 11:23 PM
First, you shouldn't be installing on any media type drives.Why??? I can install anything anywhere I please...And there isn't any "hardcoded path"
Well, what do you call "connectionstring=c:\course\dbcourse.mdb".any path is dynamic and depends on the value specified when application was packaged.Well, this is not dynamic - "connectionstring=c:\course\dbcourse.mdb" it's fixed
Installing a program on a destination drive of D: when the application has a fixed path location of it's internal files will not work... ie. "connectionstring=c:\course\dbcourse.mdb" look for this file when the app is installed on D: just won't work...
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.