In _mssql.connect, there is an option to add appname. I'm wondering if pypyodbc.connect has something similar.
Thank you.
In _mssql.connect, there is an option to add appname. I'm wondering if pypyodbc.connect has something similar.
Thank you.
Yes, as part of the connection string:
DSN=myDatabase;UID=user;PWD=pass;APP=myApp-1.0
Yes, you can use the APP=
attribute of the connection string. For example ...
import pypyodbc
connStr = """
DRIVER=SQL Server Native Client 11.0;
SERVER=(local)\SQLEXPRESS;
Trusted_Connection=Yes;
APP=My Python App;
DATABASE=myDb;
"""
db = pypyodbc.connect(connStr)
print("Okay.")
db.close()
... looks like this in SQL Server Profiler