Help w/ODBC + Access 97 & Web CGI

Benjamin Schollnick junkster at
Tue May 9 22:44:10 CEST 2000

	I'm running into a slight problem here that I'm having difficulty
tracking down.

	I'm running Python v1.52 with Win32 extensions using ODBC to
communicate with a MS Access 97 database.

	I've successfully used both MxODBC & the ODBC with the Win32

	Here's the "funny" part.  One of the tables in the database is a
"Users" table, containing, name, password, comments, etc.  

	I can access my user record (Record 0), but if I attempt to login as
any other user, the login is successful, but if I try any comments, 
the CGI
seems to lockup until the process times out from IIS.

	I don't see any obvious problems, with the database, nor the ODBC
code that I am using, in fact, the USER STATUS command I'm issuing 
reads all
the data back from a COOKIE, not from the Database....

	To illustrate:

		- Login (Read / compare data from database)
			|- Writes user record information to a cookie
		- User Status
			|- Reads data from cookie, displays on screen
		- User Edit
			|- Reads account from cookie, displays
				for editing, saves back to database

	I'm using the Cookie module from Timothy O'Malley, v2.25 05/03/2000.

	Has anyone hit a problem like this before?  I tried going through
the archives, but didn't see anything obvious in the web search's that

	Here's the ODBC wrapper, I wrote....Feel free to point out any

(Keep in mind, this is my first real attempt at ODBC related code.)

import dbi, ODBC     # ODBC modules
import time          # standard time module

def	login_to_homepage ( username='', passwd=''):
	login_string = ''
	database_conn = ODBC.Windows.Connect(     	# open a database 
       			'homepages', username, passwd)  # 'datasource/user/password'
	return database_conn

def	logout_database (database):
def	do_SQL_statement ( sql_statement, database_handle, 
database_description = None ):
	crsr = database_handle.cursor()  		# create a cursor
	crsr.execute (sql_statement)     		# execute some SQL
	database_description = crsr.description
	results = crsr.fetchall()
	return results, database_description

def	do_update_statement ( sql_statement, database_handle ):
	crsr = database_handle.cursor()  		# create a cursor
	results = crsr.execute(sql_statement)     	# execute some SQL
	#results = crsr.fetchall()
	return results

def	do_insert_into_statement ( sql_statement, data, database_handle ):
	crsr = database_handle.cursor()  		# create a cursor
	results = crsr.execute(sql_statement, data)     	# execute some SQL
	return results

          (Remove "NoSpam" to Email me)
Please feel free to copy any and or all of this sig.
A little something for spam bots:

root at localhost postmaster at localhost admin at localhost
abuse at localhost postmaster at

Chairman William Kennard: bkennard at 
Commissioner Susan Ness: sness at
Commissioner Harold Furchtgott-Roth: hfurchtg at
Commissioner Michael Powell: mpowell at
Commissioner Gloria Tristani: gtristan at
consumerline at
fccinfo at
ssegal at

More information about the Python-list mailing list