createCursor.py

import pymssql
import logging

def createCursor(serverAddress, userName, password, dataBase):
# create connection and cursor
conn = pymssql.connect(serverAddress, userName, password, dataBase, charset = "UTF-8")
logging.info("sqlServer connection Successfully Created. ")
cursor = conn.cursor()
logging.info("cursor Successfully Created. ")
return conn, cursor
posted @ 2021-10-05 20:23  石棠  阅读(37)  评论(0编辑  收藏  举报