[Calendula-devel] data migration

Bill Bell bill-bell@bill-bell.hamilton.on.ca
Fri, 12 Mar 2004 09:06:13 -0500


On 12 Mar 2004 at 8:31, Thomas Panzarella wrote:

> I'm not familiar with FileMaker (and only vaguely familiar with Access),
> but on the Access front you could use a product like
> http://www.mysql.com/portal/software/item-98.html to convert the Access
> DB to MySQL and then from MySQL you can pretty much take it anywhere (or
> leave it there since MySQL is mature and robust -- IMHO).
> 
> Also, I know Access can be used as an ODBC data source (maybe file maker
> can too???) -- so why not "roll your own" export utility? -- for example
> in Java you could use the freely supplied JDBC/ODBC bridge and pull data
> from access to whatever you want using standard JDBC.  Does Python have
> some type of bridging driver to ODBC?  Since it seems Python is your
> lang of choice, I'd check that out.

Hello, all:

I haven't been following this thread, and I haven't posted to this list before, which 
explains why I'm copying to some individuals: I'm not sure I have the right address 
for the list.

I've worked with both FM and Access. Both support ODBC, and Python offers 
convenient access to ODBC. IIRC, FM's ODBC is wobbly, and as a consequence I 
have retrieved data from FM tables as HTML files, then parsed them. Access's 
ODBC has never given me trouble, and I've used it heavily, on and off, for some 
years.

Here is some Python code to read from an Access database using ODBC. In this 
case Python reads from a table called "Students". It's just as easy to read from a 
virtual table defined with a SQL statement.

# code starts here ==============================
from win32com . client import Dispatch
from smtplib import SMTP

conn = Dispatch ( r'ADODB.Connection' )
connString = r'PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA 
SOURCE=E:\1P97\Master\students.mdb'
conn.Open ( connString )
rs = Dispatch ( r'ADODB.Recordset' )

server = SMTP ( 'smtp.vex.net', 425 )
server . set_debuglevel ( 1 )
server . login ( 'wbell', '*******' )

rs.Open ( "[students]", conn, 1, 3 )

while not rs . EOF :
    for addressField in [ 'email1', 'email2' ] :
        if rs . Fields ( addressField ) . Value :
            toaddr = rs . Fields ( addressField ) . Value
            server . sendmail ( 'bill@softwaregeneralist.ca', toaddr, """ \

Subject: Your ITIS 1P97 assignment submission code

I'm sending this message to everyone in my section of ITIS 1P97.

Your code is %s.

Please bring it with you to every laborary session.

Perhaps you could write it on a slip of paper that you keep in your billfold or 
handbag?

Thanks.

Bill Bell
""" % rs . Fields ( 'code' ) . Value )
    #~ break
    rs . Move ( 1 )

rs . Close ( )
server . quit ( )
# code ends here ==============================

Would someone mind restating the problem to be solved?

Best regards,

Bill