[egenix-users] Initial Install - Error 'vars not set'

M.-A. Lemburg mal at egenix.com
Mon Jun 12 12:56:40 CEST 2006


Nick Albright wrote:
> On Fri, 9 Jun 2006, Charlie Clark wrote:
> 
>>>> Can you please try this using something other than FreeTDS. We find it
>>>> it is responsible for lots of errors.
>>>   Yeah, be glad to!  Any recommendations/suggestions?
>> We normally recommend the openlink products. You can try them for free.
>> http.//www.openlinksw.com
> 
> 
>   Well, finally finished configuring/installing the openlink drivers, but
> get the same error:
> 
> -----Begin Error-----
> Traceback (most recent call last):
>   File "./sql_test.py", line 35, in ?
>     data = curs.fetchone()
> mxODBC.InterfaceError: mxODBCursor_Fetch called, but vars not set
> -----End Error-----
> 
> 
>   With this in the debug log:
> 
> -----Begin mxODBC.log-----
> --- New Log Session --- Fri Jun  9 15:35:14 2006
> 
> Importing the mx.DateTime C API...
>  mx.DateTime package found
>  API object mxDateTimeAPI found
>  API object loaded and initialized.
> initmxODBC: Initializing ODBC API environment
> initmxODBC:  henv=0x522f00
> mxODBC_New: server='MSSQL', uid='USER', passwd='PASS', clearAC=1
> mxODBC_InitConnection(0x2a955dd7b0):  bindmethod=1,
> have_SQLDescribeParam=1, get
> data_extensions=0x2a00000007, txn_capable=2
> mxODBC_New: created new connection at 0x2a955dd7b0hdbc=0x5720a0
> mxODBCursor_New: created new cursor '<no name>' at 0x2a955d0fa8,
> hstmt=0x587cb0
> mxODBCursor_FreeVars: called for cursor at 0x2a955d0fa8
> mxODBCursor_FreeVars: nothing to do
> mxODBCursor_Execute: using direct execute for statement 'SELECT COUNT(*)
> AS c FR
> OM items'
> mxODBCursor_Execute: number of params in statement: 0
> mxODBCursor_Execute: executing command without parameters
> mxODBCursor_FreeVars: called for cursor at 0x2a955d0fa8
> mxODBCursor_FreeVars: nothing to do
> mxODBCursor_PrepareOutput: colcount=-1 rowcount=-1

This is where the problem lies:

The ODBC driver tells mxODBC that the statement did
not generate any result set or the number of columns
in the result set cannot be determined: colcount is -1.
Consequently, mxODBC does not allocate any buffers for
output columns which is why you get the error message
when trying to fetch a row.

This could be caused by some setting in the ODBC driver,
e.g. one that implements lazy parsing or execution or
an incompatibility between the server version and the
ODBC driver or FreeTDS version used for communicating
with the database (OpenLink uses FreeTDS as well, it
only replaces the ODBC driver with a more stable one).

What's strange is your SQL is the line break 'FR\nOM'.
Perhaps this is causing the problem ?

Could you try a different statement ? And perhaps
one without 'AS c' part ?

> mxODBCursor_Free: called for cursor at 0x2a955d0fa8
> mxODBCursor_FreeVars: called for cursor at 0x2a955d0fa8
> mxODBCursor_FreeVars: nothing to do
> mxODBCursor_FreeParameters: called for cursor at 0x2a955d0fa8
> mxODBCursor_Close: called for cursor at 0x2a955d0fa8, hstmt=0x587cb0
> mxODBCursor_Close:   error cancelling; rc=1
> mxODBCursor_Close:   stmt freed
> mxODBC_Free: called for connection at 0x2a955dd7b0
> mxODBC_Close: called for connection at 0x2a955dd7b0, closed=0
> mxODBC_Close:  disconnect
> mxODBC_Close:  free connection
> -----End mxODBC.log-----
> 
> 
>   But isql works:
> 
> -----Begin isql-----
> $ isql  -v MSSQL USER PASS
> +---------------------------------------+
> | Connected!                            |
> |                                       |
> | sql-statement                         |
> | help [tablename]                      |
> | quit                                  |
> |                                       |
> +---------------------------------------+
> SQL> select count(*) as c FROM items;
> +------------+
> | c          |
> +------------+
> | 3904       |
> +------------+
> SQLRowCount returns -1
> 1 rows fetched
> -----End isql-----
> 
> 
>   :(
> 
>   Any other ideas?
> 
>   Thanks very much for your time,
>    -Nick
> 
> ---
> "Common sense is the collection of prejudices acquired by age eighteen."
> 
>         -- Albert Einstein
> 
> 
> 
> _______________________________________________________________________
> eGenix.com User Mailing List                     http://www.egenix.com/
> https://www.egenix.com/mailman/listinfo/egenix-users

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jun 12 2006)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2006-07-03: EuroPython 2006, CERN, Switzerland              20 days left

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::



More information about the egenix-users mailing list