tuple(int, int) --> FixedPoint; is there a better way?

Henrik Weber Henrik.Weber at sys.aok.de
Tue Dec 3 04:20:07 EST 2002


bokr at oz.net (Bengt Richter) wrote:
> On 2 Dec 2002 03:12:18 -0800, Henrik.Weber at sys.aok.de (Henrik Weber) wrote:
> 
> >Hello,
> >
> >I have selected a value from a currency type column in MS Access using
> >ADO. The currency type in Access is a 64 bit integer with 4 decimal
> >places precision. Somewhere between the database and my program this
> >gets turned into a tuple of two 32 bit integers, the first one signed
> >and the second one unsigned.
> >
> I don't know, but IWT there ought to be a way to get Access to give you the value
> as a decimal string with 4 digits to the right of the decimal point.
> Then Fixedpoint should be able to take that directly with no fuss.

What Access does is to return a variant with a kind of fixed point
subtype (that's Microsoftish for a variable that can take a value of
an arbitrary type to which a value of a certain type has been
assigned). When the value is passed through Pythonwin this pops out as
a tuple. I assume that the conversion takes place inside Pythonwin.
 
It's possible to put a string conversion into the query. But I'm
trying to write a DBI2 compliant module for Access, so I can't force
the future users of the module to always add a string conversion to
their queries when they process monetary data.



More information about the Python-list mailing list