Skip to content Skip to sidebar Skip to footer

Connecting To Mssql Server 2017 From Apache Http Server Via Python Script

What should be my configuration to connect with Apache from the below configuration: SERVER : DESKTOP-C6RS3DO User Name : (Default:blank) Password : (Default:blank) Conn

Solution 1:

ANSWER

try:
    cnxn = pypyodbc.connect('Driver={ODBC Driver 13 for SQL Server};'
                        'Server=DESKTOP-C6RS3DO;'
                        'Database=demo2016;'
                        'uid=sa;pwd=sa')

    print('connected <br/>')
    cursor = cnxn.cursor()

except :
    print("could not connect")
    cursor.close()
    cnxn.close()

Post a Comment for "Connecting To Mssql Server 2017 From Apache Http Server Via Python Script"