python access sql

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

    #1

    python access sql

    Hello,

    Could anyone please help me??
    Is there somebody who could explain me how to make a connection to a access
    database with a python cgi script.
    I would like to use common sql commands in my python scripts as I can with
    MySQLdb.
    But I cannot even connect to the access database (see below).
    Could anyone explain it to me as simple as possible please. I'm using
    Windows XP, ActivePython 2.3.2 build 230 and Microsoft access(XP?)
    I normally use Linux, but this has to be in MS office
    [color=blue][color=green][color=darkred]
    >>> import win32api
    >>> import win32com.client
    >>> engine = win32com.client .Dispatch("DAO. DBEngine.35")[/color][/color][/color]
    Traceback (most recent call last):
    File "<interacti ve input>", line 1, in ?
    File "C:\Python23\Li b\site-packages\win32c om\client\__ini t__.py", line 95,
    in Dispatch
    dispatch, userName =
    dynamic._GetGoo dDispatchAndUse rName(dispatch, userName,clsctx )
    File "C:\Python23\Li b\site-packages\win32c om\client\dynam ic.py", line 84,
    in _GetGoodDispatc hAndUserName
    return (_GetGoodDispat ch(IDispatch, clsctx), userName)
    File "C:\Python23\Li b\site-packages\win32c om\client\dynam ic.py", line 72,
    in _GetGoodDispatc h
    IDispatch = pythoncom.CoCre ateInstance(IDi spatch, None, clsctx,
    pythoncom.IID_I Dispatch)
    com_error: (-2147221230, 'Klasse is niet gelicenseerd voor gebruik', None,
    None)

    thank in advance,

    Arjen



  • R Baumann

    #2
    Re: python access sql

    Hi DD!

    This question would probably be better asked in the comp.lang.pytho n group
    or Mark Hammond's http://starship.python.net/crew/mhammond/ site. There are
    a number of examples on this site and on the python.org site that should be
    of help.

    HTH
    Ruben

    "DD" <ad@ad.nl> wrote in message news:bouetg$8p$ 1@news3.tilbu1. nb.home.nl...[color=blue]
    > Hello,
    >
    > Could anyone please help me??
    > Is there somebody who could explain me how to make a connection to a[/color]
    access[color=blue]
    > database with a python cgi script.
    > I would like to use common sql commands in my python scripts as I can with
    > MySQLdb.
    > But I cannot even connect to the access database (see below).
    > Could anyone explain it to me as simple as possible please. I'm using
    > Windows XP, ActivePython 2.3.2 build 230 and Microsoft access(XP?)
    > I normally use Linux, but this has to be in MS office
    >[color=green][color=darkred]
    > >>> import win32api
    > >>> import win32com.client
    > >>> engine = win32com.client .Dispatch("DAO. DBEngine.35")[/color][/color]
    > Traceback (most recent call last):
    > File "<interacti ve input>", line 1, in ?
    > File "C:\Python23\Li b\site-packages\win32c om\client\__ini t__.py", line[/color]
    95,[color=blue]
    > in Dispatch
    > dispatch, userName =
    > dynamic._GetGoo dDispatchAndUse rName(dispatch, userName,clsctx )
    > File "C:\Python23\Li b\site-packages\win32c om\client\dynam ic.py", line[/color]
    84,[color=blue]
    > in _GetGoodDispatc hAndUserName
    > return (_GetGoodDispat ch(IDispatch, clsctx), userName)
    > File "C:\Python23\Li b\site-packages\win32c om\client\dynam ic.py", line[/color]
    72,[color=blue]
    > in _GetGoodDispatc h
    > IDispatch = pythoncom.CoCre ateInstance(IDi spatch, None, clsctx,
    > pythoncom.IID_I Dispatch)
    > com_error: (-2147221230, 'Klasse is niet gelicenseerd voor gebruik', None,
    > None)
    >
    > thank in advance,
    >
    > Arjen
    >
    >
    >[/color]


    Comment

    Working...