![]() Essentially, I've defined a function in our code that sets up the sql engine conncetion: def get_conn():Ĭonn_pyodbc = nnect(DSN=, UID=, PWD=)Īnd I use the connection as such: def executeQuery(sql_query): ![]() This is how I modularize the functionality of pyodbc. If you have any suggestions here I'd be glad to hear them. I've read that there are other drivers available, but I don't have any experience with them. I am able to access a Wonderware server using Python3 both through sqlalchemy and pyodbc on Linux and Windows - I don't have a Mac so you're on your own there. I highly suspect that the Microsoft vs Mac/Linux worlds just can't be bridged in this situation. The error is probably due to the absence and unavailability of the pywin32 package, which is apparently Windows only ( Pywin32 (com objects) on Mac) That gives an error: : (InterfaceError("Windows COM Error: Dispatch('ADODB.Connection') failed.",). ![]() Historian is apparently a Microsoft SQL Server OLE DB (see pg102 of ).Īnother SO post suggests that the only python library available capable of connecting to an OLE DB is 'adodbapi' ( Connecting to Microsoft SQL server using Python)Īn attempt in code (using default RO credentials): import adodbapiĬonn = nnect("PROVIDER=INSQL Data Source= ".format(ServerName,MSQLDatabase,username,password)) ![]() ![]() Could anyone share a functional connection method to Wonderware's Historian using python3 on OSX (or linux)? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |