ODBC and date

Steve Holden sholden at holdenweb.com
Tue Jun 12 13:11:47 CEST 2001

"Maurice HUET" <m.huet at online.fr> wrote in message
news:FYHU6.106$GJ3.438333 at nnrp3.proxad.net...
> Hello,
>     I want transfert data from a progress database to a MySql database
> python and the ODBC module. (Win plateform)
>     How can I specify date selection in the SQL order ?
>     The date data cause problem (dbidate type) when i want write tem in a
> text file between then two database ?
>     Someone have a solution ?
Had you thought of writing one program that connects to both databases? It
is then relatively easy to transfer data from one to the other. Here's some
code which creates a Gadfly database from an ODBC source, doesn't use dates
but it might get you started. Two ODBC sources should be no more


# Create the gadfly database from the "Webdata" ODBC source
import gadfly
import odbc

ocn = odbc.odbc("Webdata")
ocu = ocn.cursor()

gcn = gadfly.gadfly()
gcn.startup("webdata", "gadfly")
gcu = gcn.cursor()

gcu.execute("create table PgData (PgName varchar, PgNum integer, PgText
ocu.execute("select PgName, PgNum, PgText from PgData")
gcu.execute("insert into PgData (PgName, PgNum, PgText) values (?, ?, ?)",

for obj in (gcu, ocu, gcn, ocn):

print "gadfly database created"

More information about the Python-list mailing list