I have a very similar problem to 'demoman'!
I have had to reinstall SQL Server 7 and SP3 on an NT4 Server (SP6a) and set up new (different) locations for the 10 existing databases. Both ~.mdf, and ~ldf files are to be relocated to new seperate folders.
Prior to uninstalling, I performed full backups, and then ran sp_detach_db. The detached db ~.mdf and ~.ldf files were then moved to their new locations. SQL Server reinstalled cleanly.
I am not able now either to reattach any dbs, or to restore from the previous backups.
The following SQL:-
use master
go
exec sp_attach_db
@dbname=N'atest',
@filename1=N'f:\data\databases\atest\atest.mdf',
@filename2=N'e:\SQLTransactionLogs\atest\atest.ldf'
produces the following message
Server: Msg 5105, Level 16, State 4, Line 1
Device activation error. The physical file name 'f:\data\databases\atest\atest.mdf' may be incorrect.
Attempts to restore from ~.BAK using the following SQL
Restore database atest
from
DISK = 'E:\Apps\mssql7\Appstest\atest_db_200111071900.BAK'
with
MOVE 'atest_Data.MDF' to 'F:\SQLDatabases\atest\atest.mdf',
MOVE 'atest_Log.LDF' to 'e:\SQL7TransactionLogs\atest\atest.ldf',
RECOVERY,
REPLACE
result in:-
Server: Msg 3201, Level 16, State 2, Line 1
Cannot open backup device 'E:\Apps\mssql7\Appstest\atest_db_200111071900.BAK'. Device error or device off-line. See the SQL Server error log for more details.
Server: Msg 3013, Level 16, State 1, Line 1
Backup or restore operation terminating abnormally.
SQL Server Error log contains the following
BackupDiskFile::OpenMedia: Backup device 'E:\Apps\mssql7\Appstest\atest_db_200111071900.BAK' failed to open. Operating system error = 3(The system cannot find the path specified.).
(The file and path do exist, and can be viewed by NT Explorer. File and owning folders security Permissions are currently 'Everyone- Full control')
SQL Server errorlog also contains:
udopen: Operating system error 5(Access is denied.) during the creation/opening of physical device \\IS-DEV3\DATA\Databases\atest.mdf.
and
udopen: Operating system error 3(The system cannot find the path specified.) during the creation/opening of physical device f:\data\databases\atest\atest.mdf.
The same results occur whether I am logged in as sa, dbo, or Local NT system administrator.
Any advice would be very welcome.
Thanks