By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,097 Members | 1,323 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,097 IT Pros & Developers. It's quick & easy.

Little Bugsy

P: 7
Hi i have been getting and getting this interesting bug every time ,and i dony find any solution to solve it :P

i have database bind like this :

objConnection = New OleDbConnection( _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=..\..\klienti.mdb;")

after that i have function print file dialog or save file dialog ,
where i can choose the directory to write data or print ,but
after this function is over i have been getting this thread

Could not find file 'C:\Documents and Settings\klienti.mdb'.

i think this migth be problem in system stream engine or
somewere its keeping data about my dialog and reset data about where database is stored , but its have one thing i cant bind it directly on my disk.
Apr 5 '07 #1
Share this Question
Share on Google+
5 Replies

Expert 5K+
P: 8,434
Don't forget, the "..\.." is a relative path, so will start from wherever you are at the time. This might be why the file is not found.
Apr 6 '07 #2

P: 7
how to reset to its default state ?
or how to bind a directory where to be ?
Apr 7 '07 #3

Expert 5K+
P: 8,434
how to reset to its default state ?
or how to bind a directory where to be ?
Not entirely certain I understand the question, but if you specify a complete path (that is, starting from drive or root folder) rather than a relative one, then it will continue pointing to the same place, even if you change your current folder.

For example, if you are in "C:\Temp\Dir1" then the partial path ".." refers to "C:\Temp". If you then move up one level, ".." will refer to "C:\" root directory. But a complete path such as "C:\Temp\Dir1" always means the same place. (Well, usually).

You might want to go to the Windows help and support stuff, and study up on how paths work. It's important.
Apr 8 '07 #4

P: 7
Ive solved that by strongly binded my database on to directory :)
objConnection = New OleDbConnection(My.Settings.klientiConnectionStrin g)
settings :
Provider=Microsoft.Jet.OLEDB.4.0;Data Source="C:\Program Files\Steklopaket\klienti.mdb";Persist Security Info=True;Jet OLEDB:Database Password=*******
i have been done this thru my settings because you samples of the tip of the week dont working properly throwing the error sometsing like
cant open database be sure its none of network use or been opened in exclusive mode :P
Apr 9 '07 #5

Expert 100+
P: 1,356
how to reset to its default state ?
or how to bind a directory where to be ?
Although rare but if your app and DB are in the same directory...

MsgBox "The current directory is " & CurDir

This also may be a case of the default directory changing on you although I am not 100% that this is your issue it sounds like it could be, which the following would help resolve..

FileSystem.ChDir Method

Glad you got it working though and I know hard coding things can be such a pain.
Apr 9 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.