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 |
kfsehgal
Starting Member
6 Posts |
Posted - 2012-02-15 : 12:34:04
|
I am attaching DBs using following code.Dim conn As New SqlConnection("Server=MyHomeServer\SQLExpress;Database=master;Integrated Security=SSPI") Dim cmd As New SqlCommand("", conn) cmd.CommandText = "CREATE DATABASE dbNoPWD ON ( FILENAME = 'd:\dbNoPWD.mdf' ), ( FILENAME = 'd:\dbNoPWD_log.ldf' ) FOR ATTACH" conn.Open() cmd.ExecuteNonQuery() cmd.Dispose() conn.Dispose()Please note I donot want to give any username and password.When I ran the above code and then checked SSMS, I found my attach DB was not checked in Roles The problem with this is my network computers can not access this DB. I want to run some code like above (without sa password) and want that all my network computers can access the DB without my user get involved in setting up SSMSI could not attach pic. Please visit http://stackoverflow.com/questions/9295832/sql-server-database-attaching-typesto view my pic.Thanks |
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|