ODBC, Excel DbiDate Question

Bill Witherspoon billw at witherspoon-design.com
Mon Apr 16 22:32:52 EDT 2001


Hi all,

I'm trying to output a database query (Access) to an Excel Range.
If I follow Mark Hammond's book example (thanks) I get a

TypeError: Objects of type 'DbiDate' can not be converted to a COM
VARIANT

every time it runs into a date.

I tried to convert the dates using (also borrowed from Mark ;-) ):

def fixStringsAndDates(aMatrix):
    newmatrix = []
    for row in aMatrix:
        newrow = []
        for cell in row:
            if type(cell) is int:
                pass
            elif type(cell) is float:
                pass
            else:
                newrow.append(str(cell))
        newmatrix.append(newrow)
    return newmatrix

This works, but I thought I'd check with the list if there's a better
way?

TIA,
Bill.






More information about the Python-list mailing list