[DB-SIG] Python and database problems

Max Slimmer Max.Slimmer@RightWorks.com
Thu, 4 Mar 1999 12:15:51 -0800


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01BE667B.CCE96B14
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

you might be having a problem in the displaying the dates, have you =
tried to
execute a query from the interactive python window
>>> import dbi, odbc
>>> db =3D odbc.ODBC('xxx/xxx/xxx')
>>> cur =3D db.cursor()
>>> r =3D cur.execute("Select * from someTable")
>>> ans =3D cur.fetchone()

then look at values in ans, you have to convert dbiDate values to =
readable
date first.

> -----Original Message-----
> From: Tobias H=F6ink [mailto:hoeink@uni-muenster.de]
> Sent: Thursday, March 04, 1999 1:44 AM
> To: db-sig@python.org
> Subject: [DB-SIG] Python and database problems
>=20
>=20
> Dear "Phythons",
>=20
> my name is Tobias Hoeink. I am programming for the German Society of=20
> Physicists in Muenster, Germany. For registration we use CGI-Scripts=20
> written in Python. We read information from HTML forms and=20
> put them into=20
> an Access database. So far there is no problem, everything=20
> works fine.=20
> We use two fields for dates in this Access database and this is where =

> something very strange happens:
> While reading dates out our database the date somehow changes=20
> into the=20
> date of the day before. As this seems to be a systematical=20
> error which=20
> occurs somewhere between Python and ODBC we were not able to=20
> handle it.
>=20
> To get in tough with our problem please look at
> http://dpg-akf.uni-muenster.de/dpg/dpg_liste.html
> and search e.g. for member number (Teilnehmernummer) 478. The=20
> returning
> page=20
> will show you two dates. Both are exact one day before the=20
> day saved in=20
> our database. If you search the name "Nink" (field Nachname) an other =

> listing will be presented with the same effect. I asure you that the=20
> original dates in this recordset are saved with anmeldedatum=20
> =3D 02/25/199
> and=20
> kartendatum =3D 03/25/1999.=20
> This problem occurs on any date we read out of the database!
>=20
> Please let us know what the mistake is and how we can solve=20
> the problems=20
> that are concerned with that.=20
> =20
> I would also be interested if we are the only ones presented to this
> effect.
>=20
> Thank you very much.
>=20
> I hope to hear from you soon. =20
>=20
>         Sincerely Yours,
>=20
>                 Tobias Hoeink
> --=20
> *************************************************
> 	Tobias H=F6ink			=09
> 	Heekweg 12, E408		=09
> 	48161 M=FCnster=09
> 	GERMANY		=09
> 	phone: +49-251-868852	=09
> 	email: hoeink@uni-muenster.de=09
> *************************************************
>=20
> _______________________________________________
> DB-SIG maillist  -  DB-SIG@python.org
> http://www.python.org/mailman/listinfo/db-sig
>=20

------_=_NextPart_001_01BE667B.CCE96B14
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2232.0">
<TITLE>RE: [DB-SIG] Python and database problems</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>you might be having a problem in the displaying the =
dates, have you tried to execute a query from the interactive python =
window</FONT></P>

<P><FONT SIZE=3D2>&gt;&gt;&gt; import dbi, odbc</FONT>
<BR><FONT SIZE=3D2>&gt;&gt;&gt; db =3D odbc.ODBC('xxx/xxx/xxx')</FONT>
<BR><FONT SIZE=3D2>&gt;&gt;&gt; cur =3D db.cursor()</FONT>
<BR><FONT SIZE=3D2>&gt;&gt;&gt; r =3D cur.execute(&quot;Select * from =
someTable&quot;)</FONT>
<BR><FONT SIZE=3D2>&gt;&gt;&gt; ans =3D cur.fetchone()</FONT>
</P>

<P><FONT SIZE=3D2>then look at values in ans, you have to convert =
dbiDate values to readable date first.</FONT>
</P>

<P><FONT SIZE=3D2>&gt; -----Original Message-----</FONT>
<BR><FONT SIZE=3D2>&gt; From: Tobias H=F6ink [<A =
HREF=3D"mailto:hoeink@uni-muenster.de">mailto:hoeink@uni-muenster.de</A>=
]</FONT>
<BR><FONT SIZE=3D2>&gt; Sent: Thursday, March 04, 1999 1:44 AM</FONT>
<BR><FONT SIZE=3D2>&gt; To: db-sig@python.org</FONT>
<BR><FONT SIZE=3D2>&gt; Subject: [DB-SIG] Python and database =
problems</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Dear &quot;Phythons&quot;,</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; my name is Tobias Hoeink. I am programming for =
the German Society of </FONT>
<BR><FONT SIZE=3D2>&gt; Physicists in Muenster, Germany. For =
registration we use CGI-Scripts </FONT>
<BR><FONT SIZE=3D2>&gt; written in Python. We read information from =
HTML forms and </FONT>
<BR><FONT SIZE=3D2>&gt; put them into </FONT>
<BR><FONT SIZE=3D2>&gt; an Access database. So far there is no problem, =
everything </FONT>
<BR><FONT SIZE=3D2>&gt; works fine. </FONT>
<BR><FONT SIZE=3D2>&gt; We use two fields for dates in this Access =
database and this is where </FONT>
<BR><FONT SIZE=3D2>&gt; something very strange happens:</FONT>
<BR><FONT SIZE=3D2>&gt; While reading dates out our database the date =
somehow changes </FONT>
<BR><FONT SIZE=3D2>&gt; into the </FONT>
<BR><FONT SIZE=3D2>&gt; date of the day before. As this seems to be a =
systematical </FONT>
<BR><FONT SIZE=3D2>&gt; error which </FONT>
<BR><FONT SIZE=3D2>&gt; occurs somewhere between Python and ODBC we =
were not able to </FONT>
<BR><FONT SIZE=3D2>&gt; handle it.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; To get in tough with our problem please look =
at</FONT>
<BR><FONT SIZE=3D2>&gt; <A =
HREF=3D"http://dpg-akf.uni-muenster.de/dpg/dpg_liste.html" =
TARGET=3D"_blank">http://dpg-akf.uni-muenster.de/dpg/dpg_liste.html</A><=
/FONT>
<BR><FONT SIZE=3D2>&gt; and search e.g. for member number =
(Teilnehmernummer) 478. The </FONT>
<BR><FONT SIZE=3D2>&gt; returning</FONT>
<BR><FONT SIZE=3D2>&gt; page </FONT>
<BR><FONT SIZE=3D2>&gt; will show you two dates. Both are exact one day =
before the </FONT>
<BR><FONT SIZE=3D2>&gt; day saved in </FONT>
<BR><FONT SIZE=3D2>&gt; our database. If you search the name =
&quot;Nink&quot; (field Nachname) an other </FONT>
<BR><FONT SIZE=3D2>&gt; listing will be presented with the same effect. =
I asure you that the </FONT>
<BR><FONT SIZE=3D2>&gt; original dates in this recordset are saved with =
anmeldedatum </FONT>
<BR><FONT SIZE=3D2>&gt; =3D 02/25/199</FONT>
<BR><FONT SIZE=3D2>&gt; and </FONT>
<BR><FONT SIZE=3D2>&gt; kartendatum =3D 03/25/1999. </FONT>
<BR><FONT SIZE=3D2>&gt; This problem occurs on any date we read out of =
the database!</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Please let us know what the mistake is and how =
we can solve </FONT>
<BR><FONT SIZE=3D2>&gt; the problems </FONT>
<BR><FONT SIZE=3D2>&gt; that are concerned with that. </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; I would also be interested if we are the only =
ones presented to this</FONT>
<BR><FONT SIZE=3D2>&gt; effect.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Thank you very much.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; I hope to hear from you soon.&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
Sincerely Yours,</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tobias Hoeink</FONT>
<BR><FONT SIZE=3D2>&gt; -- </FONT>
<BR><FONT SIZE=3D2>&gt; =
*************************************************</FONT>
<BR><FONT SIZE=3D2>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tobias =
H=F6ink&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; </FONT></P>

<P><FONT SIZE=3D2>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Heekweg 12, =
E408&nbsp;&nbsp;&nbsp; &nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 48161 =
M=FCnster&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
GERMANY&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; phone: =
+49-251-868852&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; email: =
hoeink@uni-muenster.de&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; =
*************************************************</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; =
_______________________________________________</FONT>
<BR><FONT SIZE=3D2>&gt; DB-SIG maillist&nbsp; -&nbsp; =
DB-SIG@python.org</FONT>
<BR><FONT SIZE=3D2>&gt; <A =
HREF=3D"http://www.python.org/mailman/listinfo/db-sig" =
TARGET=3D"_blank">http://www.python.org/mailman/listinfo/db-sig</A></FON=
T>
<BR><FONT SIZE=3D2>&gt; </FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01BE667B.CCE96B14--