0

I have been trying to run sample from MS ESENT doc and another I found, the MS sample compiles nicely on VC++ 2010 Express. However when I try either program I get an error code 0f -1216 documented as

An outstanding database attachment has been detected at the start or end of the recovery, but the database is missing or does not match attachment info.

Since this is new development, I am at a loss for what I might need to do. Anybody seen this error?

dougM
  • 77
  • 1
  • 8

1 Answers1

1

(Sorry that this is months later, maybe it will help someone else.)

You're more likely to see JET_errAttachedDatabaseMismatch during development. It is often caused by deleting some of the ESE-generated files, but not all. If you delete the database, you also should delete the log files. This scenario is common during development, when you try deleting the database, but may forget to delete the other files.

When a new database is created, there is a signature associated with it (a timestamp and a random number). You can dump this with esentutl -mh foo.edb. The transaction log files keep track of the signatures of the databases it references. If you copy in an identically-named database file from a different machine, the signatures won't match. This mismatch can sometimes show up as JET_errAttachedDatabaseMismatch (but there may be other ways for it to bubble up).

JetInit is a bit misnamed. It initiates log-file replay. If you have all of the log files from generation 1, the database engine can re-create the database file completely.

Hope that helps,

-martin

Martin Chisholm
  • 461
  • 2
  • 6