Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
BellaScout
Starting Member
25 Posts |
Posted - 2009-02-20 : 11:51:03
|
I detached a SQL Server database in order to deploy it locally but getting login password error.Here is the connectionstring I'm trying to use for the detached database:<add name="ConnectionString" connectionString="Server=.\SQLExpress;AttachDbFilename=|DataDirectory|APP_DEV_V1.mdf;User ID=APP_USER;Password=app" providerName="System.Data.SqlClient"/>I can connect fine directly to sql server using this string:connectionString="Data Source=DBSERVER;Initial Catalog=APP_DEV_V1;Persist Security Info=True;User ID=APP_USER;Password=app"I tried connecting within VS Server Explorer but get same error which kinda tells me the connection string is not the issue? What do you have to do to logon using SQL Authentication within a sql express database file? Help! |
|
mfemenel
Professor Frink
1421 Posts |
Posted - 2009-02-20 : 13:27:25
|
What is the error you're getting? You're not trying to connect to the detatched db are you? Also, what login are you using and is it's default database set to the database you've detatched?Mike"oh, that monkey is going to pay" |
 |
|
BellaScout
Starting Member
25 Posts |
Posted - 2009-02-20 : 14:40:17
|
I modified the registry following this post advice:http://sqlservernotes.blogspot.com/2007/06/enabling-sql-authentication-in.htmland I changed the service Log On to "Local System Account" and got a little farther but now have this error:"Failed to generate a user instance of SQL Server. Only an integrated connection can generate a user instance. The connection will be closed" |
 |
|
BellaScout
Starting Member
25 Posts |
Posted - 2009-02-20 : 14:58:21
|
To answer your question...yes, I'm trying to connect to the detached database as a sqlexpress file. The issue is connecting using sql authentication. |
 |
|
BellaScout
Starting Member
25 Posts |
Posted - 2009-02-20 : 15:25:52
|
What is interesting is I can connect using the sql user in sqlexpress through Server Management Studio but I cannot connect within visual studio. The connection defaults to User Instance = True within Server Explorer of Visual Studio. If I set User Instance to False and try the connection again, I get this error:"An attempt to attach an auto-named database for file c:\.... failed. A database with the same name exists, or pecified file cannot be opened, or it is located on UNC share." |
 |
|
BellaScout
Starting Member
25 Posts |
|
|
|
|