|
I am having a strange issue of being able to write to/read from an access database when I publish my windows app. I can connect to the database because I can create and view reports and view tables creating using the wizard but it will not allow me to read or write to the database when I created my own connection string. I get the following error:
"Unhandled exception has occurred in your application...Could not find file, C:...folder...path"
The connection string I'm using is: "Data Source=" & Application.StartupPath &"\databasename.mdb"
However, if I go check into the Application Files I can see that my .mdb file's publish status is Data File(Auto), which is default, and I switch that to "Include" and then publish again I can write to the database when using my coded connection string. The only problem is that I cannot view tables created from the wizard. I get the same error as before.
My problem is obviously my connection string so my question is how to I change my connection string to match what the wizard is using when it connects to a added data source?
Thanks for your help. |