|
-
Sep 4th, 2002, 06:52 AM
#1
Thread Starter
Addicted Member
Question On Database
Whenever i shift my whole project to another foreign computer i will encounter error on saying that my access file is not found and i have to rebuild the link all the time is there anyway i can put the link so that it dun search for the excat path but the folder where my .vbp is in ????
-
Sep 4th, 2002, 06:56 AM
#2
PowerPoster
hi
create the databaaaase in the same folder as your Project and use App.Path in the connection string
-
Sep 4th, 2002, 06:57 AM
#3
Thread Starter
Addicted Member
-
Sep 4th, 2002, 07:04 AM
#4
PowerPoster
hi
Use App.path in the connection string
App.Path gives you the folder of your application.
SO when you cut paste this folder on some other machine, it wouldnt lose its links.
-
Sep 4th, 2002, 07:08 AM
#5
Thread Starter
Addicted Member
um sorry but i dun really get u what u mean by app.path??? u mean i add this line inside the connection string????
-
Sep 4th, 2002, 07:11 AM
#6
PowerPoster
hi
See maybe you have a connection string like this one:
Code:
strConnectionString = "Provider=Microsoft.OLEDB.jet.4.0; data Source = C:\MYfolder\database\Mydb.MDB"
instead of this use it like this:
Code:
strConnectionString = "Provider=Microsoft.OLEDB.jet.4.0; data Source = " & App.Path & "\MyDB.mdb"
-
Sep 4th, 2002, 07:13 AM
#7
^:^...ANGEL...^:^
Hmm...
Originally posted by baby
um sorry but i dun really get u what u mean by app.path??? u mean i add this line inside the connection string????
will look something like this...
VB Code:
strConnectionLocation = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\CSSTS.mdb;" & _
"Persist Security Info=False"
-
Sep 4th, 2002, 07:15 AM
#8
Thread Starter
Addicted Member
OK THANX ALOT GUYS
-
Sep 4th, 2002, 10:42 AM
#9
Thread Starter
Addicted Member
after trying out lots and lots of time i still cant get it to work
my connection liner is as follows:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\VisualBasic\project\training.mdb;Persist Security Info=False
-
Sep 4th, 2002, 11:07 AM
#10
Frenzied Member
For it to work you must have the database in the same directory as the application - app.path is the path to the application not the database.
-
Sep 4th, 2002, 11:13 AM
#11
Let me in ..
Jesus Christ Baby,
These guys exaplained what needs to be done, and you are still doing what you were doing earlier.
Just include the app.path while you are specifying the database path in your connection string. And you keep your database where your application file(s) are on the Hard Drive. What that does for you is It looks for that database file in the same folder where your application files are. So that you can just keep your MDB file in the same folder. And you do not have to hard code the path in your connection string.
-
Sep 4th, 2002, 11:18 AM
#12
Thread Starter
Addicted Member
um guys i think i solved it already JUST put the filename without the path of the file name will do 
thanx for all the help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|