SQL2000 database vs python, using mssqldb

maxx at easynews.com maxx at easynews.com
Fri Aug 1 19:31:22 CEST 2003


>import mssqldb
>import MSSQL
>db = MSSQL.connect('my_db_server', 'user', 'password', 'my_database')
>## so far, so good
>
>c = db.cursor()
>c.execute('select * from my_table')
>## boom, error
>
>c.fetchall()
>c.nextset()
>
>The ms sql enterprise manager shows me that the database and table is there.
>Unfortunately, in python the error tells me: Invalid object name 'my_table'

A long shot, but you might try prefixing the table name with the owner name. If
the table was created by the 'sa' admin user the owner is likely 'dbo'. This can
be especially important if the table was given an explicit owner, and the user
executing the SQL are not the same.





More information about the Python-list mailing list