Connecting to MySQL

Uwe Schmitt schmitt at
Tue May 15 23:09:58 CEST 2001

Darren Watson <Darren.Watson3 at> wrote:
| Hi

| Can anyone give me any pointers about how to connect to MySQL on Windows
| using Python 2.1?

| I am fairly new to Python,

| Many Thanks

using ADO, you can write:

   from win32com.client import Dispatch

   con = Dispatch("ADODB.Connection")

   rs,error = con.Execute("select * from MyTable")

   print "--------------"
   while not rs.EOF:
	   print rs("Vorname")
	   print rs("Name")
	   print rs("Telefon")
	   print "--------------"

yours, uwe

Uwe.Schmitt at      Universität des Saarlandes
phone: +49 (0)681/302-2468     Geb. 36.1, Zi. 4.17, PF 151150
                               D-66041  Saarbrücken

More information about the Python-list mailing list