[Gambas-devel] Change to gb.db.odbc to use ODBC Connection Strings.

Benoît Minisini gambas at ...1...
Wed Mar 2 21:40:17 CET 2016


Le 26/02/2016 12:46, ML a écrit :
> Benoît,
>
> Hi. I'm attaching a quick and dirty main.c module for ODBC. I made
> the changes below to the latest revision in SVN.
>
> This module includes two new calls. One to get a proper record count
> for statements (GetRecordCount()), and another for proper ODBC error
> retrieval (reportODBCError()). I'm planning on adding the error
> retrieval routine to most debug calls when I finally get to tidy the
> module, so one can check what exactly went wrong with ODBC.
>
> GetRecordCount() basically gets to the last record, grabs its row
> number and returns it as the row count. It tries not to alter the
> current rowset position. If for any reason it cannot do it (for
> example due to having a non-scrollable rowset), it will return the
> usual -1 for backwards-compatibility with the original
> SQLRowCount().
>
> I tested it several times with two different MSSql servers at work
> using different FreeTDS protocol versions and even over the internet,
> and it seems to work. If you smell anything suspicious in it, just
> say the word!
>
> Regards, zxMarce.
>

Hi,

I have just merged your changes, changing some spaces in the code, and 
fixing the warning on 64 bits (SQLINTEGER is an int, so it requires "%d" 
in fprintf, not "%ld").

I think it would be better if you commit your changes directly in the 
subversion repository.

Regards,

-- 
Benoît Minisini




More information about the Devel mailing list