Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : SQLException: [QODBC] Invalid cursor stateSearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC v7 Forum

 New Topic 
 
 Post Reply 
[1]  
 SQLException: [QODBC] Invalid cursor state 
 Author   Message 
  amir 
  
 Group: Members 
 Posts: 9 
 Joined: 2006-08-17 
 Profile
 Posted : 2006-12-11 05:23:31

Hi,
Recently we updated our system to QODBC 7 from QODBC 6.
A query (attached below) that was working for years suddenly stop working.
The field CustomField on_hand_backup is surly created in QuickBooks.
I need this query to know for which items QuantityOnHand had been changed from the last time I ran this query.
In case there is a better way to do this please advise.

The query:
select FullName,QuantityOnHand,QuantityOnOrder,QuantityOnSalesOrder,ListID,AverageCost from ItemInventory
 where  PurchaseCost>0 and IsActive=1 and (CustomFieldon_hand_backup is null or CustomFieldon_hand_backup='' or {fn Convert(QuantityOnHand,SQL_VARCHAR)}<>
{fn rtrim(CustomFieldon_hand_backup)}  )

The exception is:
java.sql.SQLException: [QODBC] Invalid cursor state
        at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
        at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
        at sun.jdbc.odbc.JdbcOdbc.SQLFetch(JdbcOdbc.java:3189)
        at sun.jdbc.odbc.JdbcOdbcResultSet.next(JdbcOdbcResultSet.java:1313)

Amir

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-12-11 08:46:12

Custom Fields are VARCHAR (strings). Check whether:

select FullName,QuantityOnHand,QuantityOnOrder,QuantityOnSalesOrder,ListID,AverageCost from ItemInventory
where  PurchaseCost>0 and IsActive=1 and (CustomFieldon_hand_backup is null or CustomFieldon_hand_backup='')

works for you. I also like this better:-

select FullName,QuantityOnHand,QuantityOnOrder,QuantityOnSalesOrder,ListID,AverageCost from ItemInventory
where  PurchaseCost>0 and IsActive=1 and (CustomFieldon_hand_backup is null
or CustomFieldon_hand_backup=''
or QuantityOnHand <> {fn Convert(CustomFieldon_hand_backup,SQL_INTEGER)})

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to