import pyodbc
connection = pyodbc.connect('DRIVER={SQL Server};SERVER=localhost;DATABASE=Mide12;UID=sa;PWD=google)
cur = connection.cursor()
cur.execute("select * from XTSysRight")
for row in cur:
print 'No:'+row.RightTypeNo,'RightName:'+row.RightTypeName