1,105,636 Community Members

How To Set Path In Visual Basic 6

Member Avatar
locsin
Light Poster
47 posts since Aug 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

greetings!

When i First start my VB6 program with data report it works fine. The report displayed directly. but when i try to open other programs in other directory and then when i re-run my program in data report operation a msgbox appear "Please Enter MS Jet OLE DB Initialization Information"

Data Source
Username
Password
Provider String
Open mode.

It only occurs when i try to open other file in different directory. Everytime i open other file in other directory this message appear. Anybody can help me to fix this problem and how to set my original path so when i change directory and i return to my program maybe it will works fine again.

Thankyou in advance

Member Avatar
jireh
Posting Whiz
326 posts since Jul 2007
Reputation Points: 1 [?]
Q&As Helped to Solve: 51 [?]
Skill Endorsements: 0 [?]
 
0
 

Put this in Data Environment Initialization

Connection1.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sample.mdb" & ";Persist security Info=False"

hope that would help...

Member Avatar
abdulho
Newbie Poster
1 post since Aug 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

hi there, i have got this coding but its not executing...
Set db = OpenDatabase(App.Path & "\student"
my m.Access file is called student, but am getting a msg saying that it couldnt find the file student and gives the address where the file is..please help, i think there should be someting wrong in da coding...

Member Avatar
vb5prgrmr
Posting Virtuoso
1,670 posts since Mar 2009
Reputation Points: 143 [?]
Q&As Helped to Solve: 299 [?]
Skill Endorsements: 3 [?]
 
0
 

Don't forget the files extension... App.Path & "\student.mdb"


Also: To set the path, use ChDir (see help)


Good Luck

Member Avatar
zp18zp18
Newbie Poster
4 posts since Feb 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

My vb6 application opens the access data base with the vb6 database name property of the Data1 control. How can I change this to open with explicit coding in the vb coding so I can change the path in a single location?

Member Avatar
debasisdas
Posting Genius
6,542 posts since Feb 2007
Reputation Points: 580 [?]
Q&As Helped to Solve: 476 [?]
Skill Endorsements: 25 [?]
Featured
 
1
 

Please do not hijack others threads.

Please start your own thread for a new question.

Member Avatar
AndreRet
Industrious Poster
4,492 posts since Jan 2008
Reputation Points: 362 [?]
Q&As Helped to Solve: 499 [?]
Skill Endorsements: 24 [?]
 
0
 

@zp18, start a NEW and your OWN thread by clicking THIS link. You will not get any help from members by hijacking others threads.

Member Avatar
yokoshima.mur
Newbie Poster
1 post since Mar 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

'Better late than never

db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & StrDir & "SampleDB.mdb"
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article