|
-
Apr 18th, 2003, 02:32 AM
#1
Thread Starter
Registered User
-
Apr 18th, 2003, 02:43 AM
#2
Sleep mode
Re: Application.StartupPath Problem.
I didn't read the whole post but is this what you're talking about!
VB Code:
Dim MyPath as string =application.startup & "\filename.xxx"
Dim MyPassword as string =nothing
Private My_Connection As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & MyPath & ";Jet OLEDB:Database Password=" & MyPassword)
-
Apr 18th, 2003, 02:52 AM
#3
Sleep mode
Re: Re: Application.StartupPath Problem.
Little change
VB Code:
Dim MyPath As String = Application.StartupPath & "\__mydb__.mdb"
Dim MyPassword As String = nothing
-
Apr 18th, 2003, 02:52 AM
#4
Frenzied Member
Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data Source=" & Application.StartupPath "\Database\Database.mdb;Mode=Share Deny
You hamve missed & bettween Application.StartupPath and "\Database\...
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Apr 18th, 2003, 03:45 AM
#5
Thread Starter
Registered User
It is working fine now! Thank you.
-
Apr 18th, 2003, 05:13 AM
#6
New Member
don't need app.startup path
If your db resides in the same folder as the exe then you don't need application.startuppath. Just use the name of the db. Also you should be careful with Application.StartupPath as I understand it this is NOT the path to the exe but the Start In path in the shortcut. This defaults to the app.path(vb6) when the path in the shortcut is blank, however, .....
Russ
-
Apr 18th, 2003, 05:32 AM
#7
Frenzied Member
If your db resides in the same folder as the exe then you don't need application.startuppath. Just use the name of the db.
Noooooooooooo!
That works untill you have not changed the parent directory. It may happen that you change it in your application without you being noticed and so it will fail. I have faced the situation and dont recommend this at all. And here was the situation.
1. Loaded the database and filled some dataset
2. Showed the report using that dataset and Crystal Reports
3. Exported the report, for example to C:\
4. Closed the report and tryed to load the database again. It failed
Here it looks in C:\ for my database cause now the parent directory has changed without you even thinking that it has changed.
So always try the full path.
Also you should be careful with Application.StartupPath as I understand it this is NOT the path to the exe but the Start In path in the shortcut. This defaults to the app.path(vb6) when the path in the shortcut is blank, however, .....
never faced any problem with it, can you bring a smaple that makes problem?
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Apr 21st, 2003, 10:44 AM
#8
Thread Starter
Registered User
-
Apr 21st, 2003, 11:06 AM
#9
Sleep mode
They look completely different ! What have you done with it ?
-
Apr 21st, 2003, 01:51 PM
#10
Frenzied Member
It happens to me to and I think the reason is you have removed the connection from Server Explorer. Try not deleting the connection in Server Explorer in IDE or if deleted already add it again and see if it happens.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
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
|