I am attempting to create a sql connection query into an access database. This works fine if i give it an absolute path, i am trying to use the datadirectory to call it. How do i set the appdomain to tell datadirectory to use the applicationdata directory? I am trying to use the below, but it errors out with "The DataDirectory substitute is not a string." Basically i have a folder in applicationdata called BMW Maintenance and in that folder is my DB. I need to connect to it.
Dim con11 As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\BMW Maintenance\BMWMaintenance.accdb")