file read from wrong directory

Topics: Database Publishing Wizard
Jan 5, 2008 at 12:28 PM
Edited Jan 5, 2008 at 12:30 PM
I got the following error message after attempting to "publish to provider" from visual studio running on windows vista. Everthing worked fine untill I got to the end of the process and clicked finish. Then I got the error message. I appears it is looking for an mdf in a directory that doesn't exist on my computer. It looks like something from XP but on vista there is no "Documents and Settings" directory. Instead there is an Users directory. In fact I found the file located at the following path:
C:\Users\Owner\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS\msdbdata.mdf
It is very similar, but I don't know how to fix the problem. I really could use this program, but it gives me this error message everytime I click finish. Please Please...HELP

TITLE: Microsoft.SqlServer.ConnectionInfo
------------------------------

An exception occurred while executing a Transact-SQL statement or batch.

------------------------------
ADDITIONAL INFORMATION:

Unable to open the physical file "C:\Documents and Settings\Owner.ToolofGod\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS\MSDBData.mdf". Operating system error 3: "3(The system cannot find the path specified.)". (Microsoft SQL Server, Error: 5120)

For help, click: http://go.microsoft.com/fwlink?ProdName=MicrosoftSQLServer&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------
Jan 6, 2008 at 7:01 AM
I think I found a solution...

Basically since the program was looking for the MSDBData.mdf file in the wrong location I just created a junction to map the directory path over the proper location.

Steps:

1. Disable UAC (if running vista, I did this because vista's security was blocking me from doing what I needed to do, this requires a restart)
2. Add a Local Setting folder to your current users folder (note the Documents and Settings folder already has a junction to the Users folder by default)
3. Run cmd prompt
4. navigate to folder you created earlier C:\Users\yourUserName\Local Settings\
5. Create junction by typing:
C:\Users\yourUserName\Local Settings>mklink /J "Application Data" C:\Users\Owner\AppData\Local
press enter
6. It works... the fake folder is essentially mapped to the right location

You may want to double check to make sure that the place where you are junctioning to is the proper directory for you computer by making sure that you can find the MSDBData.mdf file when following out the rest of the directory path.
Jan 6, 2008 at 7:01 AM
Edited Jan 6, 2008 at 7:05 AM
I think I found a solution...

Basically since the program was looking for the MSDBData.mdf file in the wrong location I just created a junction to map the directory path over the proper location.

Steps:

1. Disable UAC (if running vista, I did this because vista's security was blocking me from doing what I needed to do, this requires a restart)
2. Add a Local Setting folder to your current users folder (note the Documents and Settings folder already has a junction to the Users folder by default)
3. Run cmd prompt
4. navigate to folder you created earlier C:\Users\yourUserName\Local Settings\
5. Create junction by typing:
C:\Users\yourUserName\Local Settings>mklink /J "Application Data" C:\Users\Owner\AppData\Local
press enter
Note: you will only be typing what is bold above... the other part is what you should see once you have navigated the right place...
6. It works... the fake folder is essentially mapped to the right location

You may want to double check to make sure that the place where you are junctioning to is the proper directory for you computer by making sure that you can find the MSDBData.mdf file when following out the rest of the directory path.
Mar 21, 2008 at 4:40 PM
I am having this problem also, but I donot want to disable the UAC. There has to be another way to get the path changed.
Mar 26, 2008 at 8:39 PM
Without disabling UAC, you can create directories until you can access "c:\documents and settings\owner\local settings\application data\" Then use cmd prompt and navigate to c:\documents and settings\owner\local settings\application data\ and type "mklink/j "application data" C:\users\owner\appdata\local". Press enter and retry the software.