OleDBConnection string

ckeezer

Well-known member
Joined
Jan 16, 2006
Messages
100
Programming Experience
1-3
Did the connection string for vs 2005 for the Applicaiton.StartUpPath change from vs2003?

I have the following as my connection string:
VB.NET:
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] conn [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDbConnection([/SIZE][SIZE=2][COLOR=#800000]"Provider=Microsoft.Jet.OleDb.4.0;Data Source="[/COLOR][/SIZE][SIZE=2] & Application.StartupPath & [/SIZE][SIZE=2][COLOR=#800000]"\SmartHouse1.mdb"[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]
[/SIZE]

but I keep getting an error that it cannot find the file in the default location of were I installed VS 2005. Shouldn't the above connect me to the db in the Bin folder of the project still?
 
No, it should do exactly the same in 2005. Return the path to the executable that started the application (not inclucing the executable) Can you get a messagebox to show you the string that is returned from it.
 
I took a look at the connection string in the Region section of code and it was set to the default location... for some reason.. made the change and error is gone... thanks for the quick reply.


2005 is a little more user friendly than 2003... liking it so far.
thanks again.
 
Back
Top