0

In my code I have:

import mdfreader

mdf = mdfreader.Mdf('SERVER.mdf')

And upon running the code, I receive an exception:

Exception: file SERVER.mdf is not an MDF file!

The MDF file is in the same folder as my Python program.

If it cannot be fixed:

  • Is my MDF file corrupt?
  • How can I get the data out of my file? I've also tried the asammdf library but it didn't work.

Documentation for the mdfreader module is appreciated. I'm new to programming, so sorry if this is a stupid question!

Shoes
  • 1
  • 1
    The question is, what kind of MDF file you have and what kind of file you want to open. Is it MDF for Measurement Data Format, MDF for Master Database File used by Microsoft SQL Server or MDF file used by the Media Disc Image File used by Alcohol Software apps? The library you mentioned can open the first type of files (Measurement Data Format) but from the file name I'm guessing it's rather SQL Server file. What's your case? – Kamil Sep 02 '22 at 12:04
  • Does this answer your question? [Python open Microsoft SQL Server MDF file](https://stackoverflow.com/questions/11298061/python-open-microsoft-sql-server-mdf-file) – Kamil Sep 02 '22 at 12:09

0 Answers0