matt09524 Posted October 8, 2005 Posted October 8, 2005 (edited) I'm looking for a way to tell the connection wizard, specifically the part about telling it where the db file is, that I want it to look in the application path for the file. These won't work: Application.startuppath & \dbdata.mdb Application.startuppath & "\dbdata.mdb" I had created a whole app that took me quite a while only to find out that when I deployed it, it is still looking in the bin directory of the project for the database file. I also tried just adding a new connection string redefining the connection in the form_load method (see below) but that throws an exception when trying to fille the dataset. OleDbConnection2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Application.StartupPath & \dbdata.mdb;User Id=admin;Password=;" Im convinced there has to be a way to set the correct path in the wizard. Edited October 8, 2005 by matt09524 Quote
bri189a Posted October 8, 2005 Posted October 8, 2005 I have yet to see the wizard take application variables as part of the connection...generally it's not a big deal thought since I rarely use the wizard; but if you ever find a way, let us know! Quote
matt09524 Posted October 9, 2005 Author Posted October 9, 2005 I think you're right. I had to change my code to check to see if the db file was where I set it at design time (which it won't be) and if not, use the coded connection string instead. I wish it would use relative path in the wizard. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.