954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How To Set Path In Visual Basic 6

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

locsin
Light Poster
47 posts since Aug 2007
Reputation Points: 10
Solved Threads: 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...

jireh
Posting Whiz
316 posts since Jul 2007
Reputation Points: 11
Solved Threads: 49
 

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...

abdulho
Newbie Poster
1 post since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

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


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


Good Luck

vb5prgrmr
Posting Virtuoso
1,912 posts since Mar 2009
Reputation Points: 156
Solved Threads: 296
 

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?

zp18zp18
Newbie Poster
4 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

Please do not hijack others threads.

Please start your own thread for a new question.

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

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

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You