Pervasive 8 and Python
2 answers
I'm not familiar with Pervasive, but from a quick search on the internet it seems that people are using some kind of ODBC driver to access Pervasive 8.
ODBC databases can be used from python on Windows using PyODBC: http://code.google.com/p/pyodbc/
+2
source to share
Yes, you can. here is the working code
import os
import sys
import pyodbc
def main():
conn_str = 'Driver={Pervasive ODBC Interface};server=localhost;DBQ=DATABASENAME'
db = pyodbc.connect(conn_str)
c = db.cursor()
c.execute("SELECT COUNT(*) FROM TABLENAME")
row = c.fetchone()
if row:
print(row)
return 0
if __name__ == "__main__":
sys.exit(main())
0
source to share