Calling Access module functions from python

Discussion in 'Python' started by kayakerjess, Sep 21, 2005.

  1. kayakerjess

    kayakerjess Guest

    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.client.Dispatch('Access.Application')
    conn.OpenAccessProject("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
     
    kayakerjess, Sep 21, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Vallstrom
    Replies:
    2
    Views:
    1,911
    Kevin Bracey
    Nov 21, 2003
  2. Mark Carter
    Replies:
    1
    Views:
    489
    Koczian
    Jul 11, 2003
  3. kayakerjess
    Replies:
    1
    Views:
    396
    Chris Smith
    Sep 23, 2005
  4. S?ren Gammelmark
    Replies:
    1
    Views:
    1,902
    Eric Sosman
    Jan 7, 2005
  5. Ross A. Finlayson
    Replies:
    19
    Views:
    610
    Keith Thompson
    Mar 10, 2005
Loading...

Share This Page