I have a project using an Access database. I go to data connections in VS and create a connection, I select the db which has a path of [my project folder]app_datastats.accdb
and test the connection and it works fine, so I save it. VS then doesn’t allow me to access the DB, it puts a red X on it under data connections in server explorer. When I go to modify the connection, the path has been changed to |DataDirectory|stats.accdb
.
This would be fine, but when I test the connection, it says Could not find the file 'cprogram filesMicrosoft visual studio2022CommunityCommon7IDEstats.accdb'
How to I change it so the |Data Directory|
points to where the database is?
DennisB is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.