If the exe and the mdb are together in the same bin folder, then you can get
the full path without hardcoding it, just getting the path portion of
System.Reflection.Assembly.GetExecutingAssembly.Lo cation.
--
Best regards,
Carlos J. Quintero
MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
"freddy" <fr****@discussions.microsoft.com> escribió en el mensaje
news:CD**********************************@microsof t.com...
I would like to put an access db in the bin folder and not hard code it.
Code: <-- I would like to do this:( when I try it, it does not work)
string sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Project.mdb";
Instead of this:, <--this work fine
string sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=E:\\Freddy\\Projects\\vb.net\\Project Track It\\bin\\Project.mdb";