Testing ODBC, what am I missing?

Franz GEIGER fgeiger at datec.at
Fri Jan 26 02:04:46 EST 2001


I did it this way:

import dbi
import odbc


class G:
    sDSN = "Excel2Python"


def main():
    print
    print "Script '%s' has started: %s. " % (ScriptFN(), TTime().Now())

    print
    print >> stdout, G.sDescription

    conn = odbc.odbc('Excel2Python')
    cursor = conn.cursor()

    cursor.execute('SELECT * FROM "MyTable$"')

<snip>

It's not via mxODBC, but it works.

As I understood, if you use mxODBC you have to "hide" the standard ODBC
stuff somehow. Have a look into Mark Hammond's book if you have access to
it.

Regards
Franz


"Jay O'Connor" <joconnor at cybermesa.com> wrote in message
news:3a70be19.73570291 at news.cybermesa.com...
> I download and installed mxODBC, I'm trying to do some small testing
> so I'm using the the Text and Excel drivers under windows
>
> When I try so a Connect() I get
>
> >>> db = ODBC.Windows.Connect ("TestDatabase")
> Traceback (innermost last):
>   File "<pyshell#24>", line 1, in ?
>     db = ODBC.Windows.Connect ("TestDatabase")
> NotSupportedError: ('S1C00', 84, '[Microsoft][ODBC Excel Driver]Driver
> not capable ', 4226)
>
> When I try using DriverConnect, I get
>
> >>> db = ODBC.Windows.DriverConnect ("TestPersonDB")
> Traceback (innermost last):
>   File "<pyshell#22>", line 1, in ?
>     db = ODBC.Windows.DriverConnect ("TestPersonDB")
> OperationalError: ('IM002', 0, '[Microsoft][ODBC Driver Manager] Data
> source name not found and no default driver specified', 4316)
>
> Any ideas?
>
> Both databases are in the System DSN
> Jay O'Connor
> joconnor at cybermesa.com
> http://www.cybermesa.com/~joconnor
>
> "God himself plays on the bass strings first, when he tunes the soul"





More information about the Python-list mailing list