FAQ Database Discussion Community


Connecting to ODBC using pyODBC

python,ms-access,odbc,pyodbc,dsn
I've read all the faq pages from the python odbc library as well as other examples and managed to connect to the DSN, using the following code: cnxn = pyodbc.connect("DSN=DSNNAME") cursor = cnxn.cursor() cursor.tables() rows = cursor.fetchall() for row in rows: print row.table_name but for everything else I keep getting...

Unable to connect to SQL Using DSN from IIS

c#,sql,asp.net,iis,dsn
I am trying to connect to a DSN in my machine through IIS. My code is like this internal class ODBCClass:IDisposable { private readonly OdbcConnection oConnection; private OdbcCommand oCommand; public ODBCClass(string DataSourceName) { //Instantiate the connection oConnection = new OdbcConnection("Dsn=" + DataSourceName); try { //Open the connection oConnection.Open(); //Notify the...

SQLGetInfo - How to use this function

c#,database,odbc,oledbconnection,dsn
I have developed a c# application which connects to many types of database servers like Sql,Oracle,Mysql etc..Connection was established using ODBC. I need to find the server type (DBMS type) for which the connection was established, as the user only enters the DSN name. After several hours of surfing, I...