|
-
Oct 21st, 2012, 08:13 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] My |DataDirectory| is messed up
My Visual Studio is acting very strangely. When installing a data source, the designer kept getting messed up. When I ended up doing is creating a new application, copying the database into the base address of my app (same place as Form1.vb), and then adding the source. It warned me that it was not in my application, and I told it to copy it.
This worked in my new application, so I copied my code from my original application attempt (the code in my original Form1.vb file). Everything worked fine. Then I changed the Database property from Always Copy to Never Copy. Now the application will not run, and the system indicates it can't find the file - but it is looking in my original \bin\debug location, not my new \bin\debug location. The line setting up the connection string is:
Code:
pCn = New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\ArticleCites.accdb; Persist Security Info=False;")
it is the |DataDirectory| that is pointed to the wrong location. My question is Where is the |DataDirectory| set? I know normally the default would be \bin\debug in my application subdirectory, but somehow this got messed up and I am trying to reset it to the proper setting.
Any help would be appreciated.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|