Calling Access module functions from python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kayakerjess

    #1

    Calling Access module functions from python

    Hi,

    I have an Access Data Project (.adp) that I am trying to open and
    execute from Python. I am using the win32com.client , and I have
    successfully opened the application, but I'm getting an exception when
    I try to execute the function (actually a "Sub" that returns void, but
    that shouldn't matter). Here's what I have so far:


    conn=win32com.c lient.Dispatch( 'Access.Applica tion')
    conn.OpenAccess Project("C:/path/to/file/filename.adp")
    conn.Visible = 1
    # works so far

    conn.Run("test_ interface")

    # Exception is thrown here.
    # com_error: (-2147352567, 'Exception occurred.', (0, None, None, None,
    0, -2147352562), None)

    The 'test_interface ' function takes no arguments, but I've tried the
    same thing with another function that does take arguments and gotten
    the same result.

    Any help would be appreciated.

    Thanks,
    kayakerjess

Working...