Last active
March 24, 2023 05:51
-
-
Save charlesreid1/28299e1977c832b163e3 to your computer and use it in GitHub Desktop.
Gist illustrating how to connect to a GE Proficy iHistorian OLEDB instance from Python. This uses the PyADO library (http://pyado.sourceforge.net).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PyADO | |
#print help(PyADO.connect) | |
conn = PyADO.connect(None,host='localhost',user='',password='',provider='iHOLEDB.iHistorian.1') | |
print conn | |
curs = conn.cursor() | |
curs.execute("SELECT * FROM ihTags") | |
result = curs.fetchall() | |
descr = curs.description | |
for col in descr: | |
print col[0], | |
for row in result: | |
for col in row: | |
print col, | |
curs.close() | |
conn.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello,I run your code in my computer recently,However,the code get exception:
pywintypes.com_error: (-2147352567, '发生意外。', (0, 'ADODB.Connection', '对象关闭时,不允许操作。', 'C:\WINDOWS\HELP\ADO270.CHM', 1240653, -2146824584), None)
I find all kinds of method for this,but not sovle it.Do you know the problem of it?please help me.thanks for your consideration