Use bind variables instead. Here's the spec for working with DBs in Python: PEP 249: Python Database API Specification v2.0.
UPDATE: Based on the docs for pymssql
, you need something like:
sql = """
INSERT INTO [SCHOOLINFO]
VALUES(
%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, %s, %s, %d
)"""
cur.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)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…