, , MySQLdb. :
import _mysql
db = _mysql.connect("localhost","user","password","database_name")
cursor = db.cursor()
sql = """
INSERT INTO [SCHOOLINFO]
VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
"""
cursor.execute(sql, [self.accountNo, self.altName, self.address1, \
self.address2, self.city, self.state, self.zipCode, \
self.phone1, self.phone2, self.fax, self.contactName, \
self.contactEmail, self.prize_id, self.shipping, \
self.chairTempPass, self.studentCount])
, INSERT. , None NULL . , , SQL-.
mysql, , , .
EDIT -
SQL Server, pyobbc. http://code.google.com/p/pyodbc/. :
import pyodbc
conn = pyodbc.connect('DRIVER={SQL Server};SERVER=localhost;DATABASE=database_name;UID=user;PWD=password')
cursor = conn.cursor()
sql = """
INSERT INTO [SCHOOLINFO]
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
"""
cursor.execute(sql, self.accountNo, self.altName, self.address1, \
self.address2, self.city, self.state, self.zipCode, \
self.phone1, self.phone2, self.fax, self.contactName, \
self.contactEmail, self.prize_id, self.shipping, \
self.chairTempPass, self.studentCount)
conn.commit()