Unable to print from VB.NET using Access??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Infog
    New Member
    • Dec 2008
    • 36

    #1

    Unable to print from VB.NET using Access??

    I found this for Access Automation:
    How To Automate Microsoft Access From Visual Basic .NET

    BUT, the "Imports" statement given on that page doesn't work in VB.NET Express 2008, so far as I have found.
    Code:
    Imports Microsoft.Office.Interop
    Why is this? Is there a way around it, without buying Crystal Reports or Visual Studio Pro?

    Thank you.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Have you added a reference in your project to the Access library?
    • On the Project menu, click Add Reference.
    • On the COM tab, locate Microsoft.Offic e.Interop.Acces s and then click Select.

    If you have already done this and are still experiencing an error please tell us what the error message is so that we can continue to help you.

    -Frinny

    Comment

    • Infog
      New Member
      • Dec 2008
      • 36

      #3
      Aha, that did it. Thank you! I believe what I click on was actually listed as Microsoft Office 12 Access Object Library, but close enough I guess.

      Comment

      • Infog
        New Member
        • Dec 2008
        • 36

        #4
        I'm getting an error on this line:
        Code:
        oAccess.OpenCurrentDatabase(filepath:=sDBPath, Exclusive:=False)
        7866: Microsoft Access can't open the database because it is missing, opened exclusively by another user, or not an ADP file.

        The file does exist at the path it is looking for, and isn't open when .NET asks to open it.

        Comment

        Working...