jstiegelmeyer
Programmer
Hello-
I am baffled, and I need help from someone who is smarter than me!
I am using a Visual Basic App to restore a backup db file to my SQL Server.
dbConn.Execute "RESTORE DATABASE MyDBName " _
& "FROM DISK = 'MyPath\MyFileName.bak' " _
& "WITH REPLACE"
dbConn is a different database than MyDBName, but within the same server. This usually works fine as long as there are no open connections to the database I am restoring.
This works for most of my clients, but I am consistently getting an error message from one of my clients. And I can't figure out what is different about their setup from the rest.
This is the error message:
"-2147217900, [Microsoft][ODBC SQL Server Driver][SQL Server]Processed 1112 pages for database 'MyDBName', file 'MyDBName_dat' on file 1."
After this occurs, the SA goes in and detaches the database and then reattaches it. After that is done, the problem is solved and the new db is restored.
Obviously, I would like to avoid this step. I would like to have the code work so that I don't require any human involvement.
Any help would be HUGELY appreciated!
Thanks,
Jamie
I am baffled, and I need help from someone who is smarter than me!
I am using a Visual Basic App to restore a backup db file to my SQL Server.
dbConn.Execute "RESTORE DATABASE MyDBName " _
& "FROM DISK = 'MyPath\MyFileName.bak' " _
& "WITH REPLACE"
dbConn is a different database than MyDBName, but within the same server. This usually works fine as long as there are no open connections to the database I am restoring.
This works for most of my clients, but I am consistently getting an error message from one of my clients. And I can't figure out what is different about their setup from the rest.
This is the error message:
"-2147217900, [Microsoft][ODBC SQL Server Driver][SQL Server]Processed 1112 pages for database 'MyDBName', file 'MyDBName_dat' on file 1."
After this occurs, the SA goes in and detaches the database and then reattaches it. After that is done, the problem is solved and the new db is restored.
Obviously, I would like to avoid this step. I would like to have the code work so that I don't require any human involvement.
Any help would be HUGELY appreciated!
Thanks,
Jamie