Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#87 odbc data retrievel not working when SQLRowCount =-1

closed-fixed
5
2009-01-16
2009-01-15
Christoph Klein
No

most odbc drivers don't report the full length of the query until they've reached the end of the resultset. In this case SQLRowCount returns with -1.
The odbc import routine checks the numbers of rows when retrieving data (file plugin/odbc_import.c line 346 gretl 1.7.9).
Attached you will find the sql log which shows that after returning -1 for sqlrowcount, gretl closes the databse connection.

Discussion

  • Sql Log of gretl

     
    Attachments
    • summary: odbc data retrievel now working when SQLRowCount =-1 --> odbc data retrievel not working when SQLRowCount =-1
     
  • Allin Cottrell
    Allin Cottrell
    2009-01-16

    • labels: --> data storage/retrieval
    • assigned_to: nobody --> allin
     
  • Allin Cottrell
    Allin Cottrell
    2009-01-16

    Could you please re-identify the point in the gretl code that you have in mind?
    plugin/odbc_import.c has 344 lines of code, so line 346 is out of bounds. There's
    a call to SQLRowCount() on line 257, with a check using the OD_error macro on
    the return value, where

    #define OD_error(r) (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO)

    Is this the point in the code that you mean? Thanks.

     
  • Allin Cottrell
    Allin Cottrell
    2009-01-16

    OK, I think I get the point, and have attempted a fix.

    We'd be grateful if you could see if this now works on your
    ODBC server, with gretl CVS or the Windows snapshot, at
    http://ricardo.ecn.wfu.edu/pub/gretl/gretl_install.exe

     
  • yes, now it works. I'am able to download data from a Microsoft Access Database. Thanks a lot!

     
  • Allin Cottrell
    Allin Cottrell
    2009-01-16

    Excellent. Thanks for your help.

     
  • Allin Cottrell
    Allin Cottrell
    2009-01-16

    • status: open --> closed-fixed