=== pymssql.py
==================================================================
--- pymssql.py	(revision 8485)
+++ pymssql.py	(local)
@@ -197,6 +197,8 @@
 		x = "'" + string.replace(str(x), "'", "''") + "'"
 	elif type(x) in (types.IntType, types.LongType, types.FloatType):
 		pass
+	elif type(x) == types.BooleanType:
+		x = x and 1 or 0
 	elif x is None:
 		x = 'NULL'
 	elif hasattr(x, '__pg_repr__'):
@@ -225,6 +227,7 @@
 
 	def __init__(self, cnx):
 		self.__cnx = cnx
+		self.__autocommit = False
 		try:
 			self.__cnx.query("begin tran")
 			self.__cnx.fetch_array()
@@ -240,6 +243,8 @@
 	def commit(self):
 		if self.__cnx == None:
 			raise OperationalError, "invalid connection."
+		if self.__autocommit == True:
+			return
 		try:
 			self.__cnx.query("commit tran")
 			self.__cnx.fetch_array()
@@ -251,6 +256,8 @@
 	def rollback(self):
 		if self.__cnx == None:
 			raise OperationalError, "invalid connection."
+		if self.__autocommit == True:
+			return
 		try:
 			self.__cnx.query("rollback tran")
 			self.__cnx.fetch_array()
@@ -266,9 +273,20 @@
 			return pymssqlCursor(self.__cnx)
 		except:
 			raise OperationalError, "invalid connection."
+        
+	def autocommit(self,status):
+		if status:
+			if self.__autocommit == False:
+				self.__cnx.query("rollback tran")
+				self.__cnx.fetch_array()
+				self.__autocommit = True
+		else:
+			if self.__autocommit == True:
+				self.__cnx.query("begin tran")
+				self.__cnx.fetch_array()
+				self.__autocommit = False
 
 
-
 # connects to a database
 def connect(dsn = None, user = "sa", password = "", host = "127.0.0.1", database = "master"):
 	# first get params from DSN
