From d4t4full at ...176... Fri Feb 26 12:46:33 2016 From: d4t4full at ...176... (ML) Date: Fri, 26 Feb 2016 08:46:33 -0300 Subject: [Gambas-devel] Change to gb.db.odbc to use ODBC Connection Strings. Message-ID: <56D03B19.2040102@...176...> 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. -------------- next part -------------- A non-text attachment was scrubbed... Name: gb.db.odbc-main.c.tar.gz Type: application/gzip Size: 15252 bytes Desc: not available URL: