help with my first use of a class
BartlebyScrivener
rpdooling at gmail.com
Fri Oct 20 02:32:57 EDT 2006
Whoah. At least I got the connection. I think. Maybe I can figure more
on my own. Any help appreciated.
Thanks
---------
class Connection:
def __init__(self, aDatasource):
self.db = aDatasource
self.conn = odbc.DriverConnect(self.db)
self.conn.cursor()
def random_quote():
"""
Counts all of the quotes in MS Access database Quotations2005.mdb.
Picks one quote at random and displays it using textwrap.
"""
c = Connection('DSN=Quotations')
c.execute ("SELECT COUNT(Quote) FROM PythonQuoteQuery")
More information about the Python-list
mailing list