locked
Opening a mdb with C# and extracting forms, tables,etc RRS feed

  • Question

  • User483055775 posted

    I am on a project to convert a large number of mdb applications as well as some later version applications, the 2010 and 2013 versions to dot net.  Can someone point me at documentation on how to read (these are not password protected or anything like that) the .mdbs and extract the information from them.  Thanks

     

    DonnieS

    Tuesday, January 14, 2014 7:52 PM

Answers

All replies

  • User-1199946673 posted

    You can connect to Access files using OleDb. Note that you can only access the Tables and Queries. You cannot access the forms, reports and Modules.

    http://www.mikesdotnetting.com/Article/78/AccessDataSource-SqlDataSource-and-connecting-to-Access-databases-in-ASP.NEThttp://www.mikesdotnetting.com/Article/26/Parameter-Queries-in-ASP.NET-with-MS-Access

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 14, 2014 8:09 PM
  • User483055775 posted

    Thanks - that should get me started.  I have a problem with "cannot access"  lol,  got to find a way to do get the forms, reports and modules.

     

    Tuesday, January 14, 2014 8:39 PM
  • User-1199946673 posted

    I have a problem with "cannot access"  lol,  got to find a way to do get the forms, reports and modules.

    Forms, reports ans modules are meant to be used in an Access Environment (you need ACCESS or the ACCCES runtime), and CANNOT be used in a ASP.NET environment (you CANNOT use Acccess or the Access runtime in a web environment). So why do you want to access those objects?

    Wednesday, January 15, 2014 4:52 AM
  • User483055775 posted

    Hans, because I am converting these mdb apps to asp.net C# and need to be able to list out what controls are being used in each form and report.

    Wednesday, January 15, 2014 6:15 AM
  • User-1199946673 posted

    need to be able to list out what controls are being used in each form and report.

    And why can't you do that in Access?

    Wednesday, January 15, 2014 2:59 PM
  • User483055775 posted

    Because I want to use C# to do it. 

    Wednesday, January 15, 2014 3:12 PM
  • User-1199946673 posted

    If you insist.... The only way you can access those objects is to use the Microsoft.Office.Interop.Access assembly. But read this before you do!

    "Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment."

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2 

    Wednesday, January 15, 2014 4:56 PM
  • User483055775 posted

    Hans, thanks so much,  we are trashing these MS Access apps when we complete the conversion to dot net so we are ok.  And these will be opened read only - we wont be changing anything.

     

    Wednesday, January 15, 2014 7:41 PM