Restoring DB made ADO.NET not connect?

  • Thread starter Thread starter SStory
  • Start date Start date
S

SStory

I Restored a MSDE database--with a prior backup. Now my program won't
connect to it.

I use SQL Security.

Any ideas?

Thanks,

Shane
 
SStory said:
I Restored a MSDE database--with a prior backup. Now my program won't
connect to it.

I use SQL Security.

Delete and recreate the user on the database. (The entry at the server
level should be fine.)
 
If not saved on the same machine the problem is that the login is not the
same as the user account in your database (despite the same name, SQL Server
uses actually an internal id).
To remap the two accounts see the sp_change_users_login stored procedure (in
case dropping/creating the user would force to redo some grants).

Patrice
 
I suspected something like this.
But this makes it really difficult to make a simple backup/restore for my
users.
They won't be able to do this easily.

I guess part of my restore would have to be dropping and recreating the
login and user accounts.

Thanks for your input.

Shane
 
Thanks,

Mike Swaim said:
Delete and recreate the user on the database. (The entry at the server
level should be fine.)

--
Mike Swaim (e-mail address removed) at home | Quote: "Boingie"^4 Y,W & D
MD Anderson Dept. of Biostatistics & Applied Mathematics
(e-mail address removed) or (e-mail address removed) at work
Disclaimer: Yeah, like I speak for MD Anderson.
 
thanks Patrice, for some reason it is working now.
I ran that command. It said number of orphans fixed 0 or something like
that.
But now it works. of course I had rebooted also. So who knows.

I will execute this command after the user does a restore everytime.

Shane
 
If this is on the same server, you shouldn't have this problem.

Not familier with MSDE. Do you do this while your app is running ?
 
I just have a vb.net app. It connects to MSDE. Needed to offer backup and
restore for users...albeit a simple one. They want better than can buy
better. I just wanted to offer a barebones simple recovery backup so that
it comes out of the box with some backup capabilities.

At present I ran that from query analyzer--but they won't have query
analyzer and will run through and ADO.NET command object to execute the
backup/restore text.

Thanks,
 
Back
Top