Database not found !
My web.config file has this bit of code:
<connectionStrings>
<add name="AppConnectionString1" connectionString="Data Source=".\SQLEXPRESS";AttachDbFilename="C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf";Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
But........................... the is no "AdventureWorks_Data.mdf" in that folder ?
And the database is installed in the right place !
help !
Where is the AdventureWorks_Data.mdf file located? AttachDbFilename must point to the location of the mdf file. It sounds like you have the wrong connection string. If you're not putting the database into the Data folder, then you need to change your connection string to point to the correct location.
Regards,
Mike Wachal
SQL Express team
-
Mark the best posts as Answers!
|||
Did this resolve the issue?
Mike
|||Hmmm
I've downloaded and installed the Adventure works database
I follow the instructions give here
http://msdn2.microsoft.com/en-us/library/ms310325.aspx
but this command here:
exec sp_attach_db @.dbname=N'AdventureWorks', @.filename1=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf', @.filename2=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_log.ldf'
results in this error:
unable to open physical file,................................................. the system can't find the specified file.
The things is....................... i can't find a "AdventureWorks_Data.mdf" file.
|||
When you downloaded and installed the AdventureWorks sample, you were probably asked for a directory to install to, that's where the database should be. If you don't recall where it went, try searching your hard drive for it. (Start | Search and then look for "AdventrueWorks*")
Once you know where it is, you can either change the path in the command above, or you can move it to the Data directory for the instanse of SQL that you want to attach it to. If search doesn't find the file, that probably means it either didn't get installed, or it was deleted. Try installing again. You may have to uninstall the sample from Add/Remove Programs before you can install it again.
Mike
|||I basically have the same problem; however, I do have the: AdventureWorks_Data.mdf and AdventureWorks_log.ldf files in the proper directory. But I do a 'search' and do not see the 'AdventureWorks' db file.
I run the script:
exec sp_attach_db @.dbname=N'AdventureWorks', @.filename1=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf', @.filename2=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_log.ldf'
and get:
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'AdventureWorks'. CREATE DATABASE is aborted.
Msg 602, Level 21, State 50, Line 1
Could not find row in sysindexes for database ID 9, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
Thanks for any help in advance...
No comments:
Post a Comment