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_data\stats.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 'c\program files\Microsoft visual studio\2022\Community\Common7\IDE\stats.accdb'
How to I change it so the |Data Directory|
points to where the database is?