[PythonCE] SQLite database with comtypes

Tod Haren ke7fxl at gmail.com
Thu Jun 29 08:39:32 CEST 2006

Are other users having success with SQLite under PythonCE 2.4.3?  Are
you using pySQLite, comtypes, ctypes, or some other method?  I'm
having trouble getting started on the PPC.  On the desktop it seems to
work fine.

I've been trying to use comtypes to access a dll put out by the folks
at newObjects, since I'm not set up to build SQLite from source and
can't seem to find a binary anywhere.  If I had the WinCE SQLite
binary I suppose PySQLite would work.  Any tips, links, etc.?

The problem I'm having with the newObjects.sqlite.dbutf8 com module is this:

    from comtypes.client import CreateObject
    conn = CreateObject('newObjects.sqlite.dbutf8')
    conn.Open('\\some path\\aSQLiteDB.db')
    rs = conn.Execute("SELECT name FROM sqlite_master WHERE type='table';")
      Traceback (most recent call last):
(Very long traceback, here's just the last couple lines of it)
      File "\SD Card\PythonCE Python24\lib\ctypes\__init__.py", line
312, in __getitem__
        func = self._FuncPtr((name_or_ordinal, self))
    AttributeError: function 'SafeArrayCreateVectorEx' not found

The first time I ran CreateObjects on this the generate routines
appeared to finish properly.  I have not had problems with other com
modules, but my experience is very limited here.

This is beyond my limited knowledge at this point, of Python and Com
programming.  Any assistance would be greatly appreciated.


More information about the PythonCE mailing list