Topic: Recorder 6 blank database mdf

Also posted on Recorder e group

In the process of testing out Recorder 6 we have continued to enter data (and delete a few items via merges) in 2002. When I compare the databases I therefore see some items in 6 not in 2002.

Rather than having to delete each item in 6 I want to attach a new blank version of the database files (the .mdf and .ldf files). I have installed a standalone msde version on a pc and then copied off that machine the NBNData_Data.mdf and NBNData_Log.ldf. I then detached the NBNData database on the SQL Server, moved the files elsewhere and then copied into their place the new blank database files.

I went to attach the new files and it came up with the following message:

Error 5173: Cannot associate files with different databases.

I tried to attach it via the Query Analyzer too, but it too did not work.

Looking on the internet I found the following query:

dbcc checkprimaryfile (N'D:\Program Files\Microsoft SQL
Server\MSSQL\Data\ABC2.mdf', 3)

I replaced the location above with the new one on the server and it came up with a different logical file name location, i.e. the location it was installed onto the PC harddrive!

I managed to re-attach the original database (thankfully!) but it does not solve the problem.

Can anyone help please? Is the location of the mdf file hard coded in itself somewhere and can that be changed as this would probably allow it to attach, perhaps?



Brian Miller
BMERC Manager

Re: Recorder 6 blank database mdf


Couple of things to check: did you first detach the mdf from the msde install? If not, do that first. Next, don't bother trying to re-attach the log file (the ldf) - get rid of it from the destination directory and untick it in the re-attach interface. SQL Server will create a new one for you when you reattach. I've had problems with log files and locations before now, so it it's worth a try.