[Gambas-devel] gb.odbc new

Benoit Minisini gambas at ...1...
Sat Nov 5 01:11:36 CET 2005


On Thursday 03 November 2005 12:44, Andrea Bortolan wrote:
> Hi all,
> here the new version of the odbc driver.
> I added a check in order to call SQLFetch instead the
> SQLFetchScroll api when the odbc driver does not
> support the SQLFetchscroll call.
> If the driver does not support SQLFetchscroll then
> SQLFetch is called and the result set cannot be
> refetched, this can be a problem if the application
> fetchs the rows till the end and after try to refetch
> it from the beginning, odbc will rise the end of data
> error.(This is why I initially used only the
> SQLFetchScroll)
> This problem occurs using i.e. both, Database example
> and Gambas Database Manager because they need to fetch
> all the result set to know the numbers of rows and
> then refetch all the rows again to retrieve the data.
> To avoid this problem the application should allocate
> the result set row by row fetching one row at time and
>  not creating the whole result set based on the rows
> number.
> Let me know if this can work correctly on Informix.
> Ciao, Andrea
>

Hi, Andrea.

Do you have to call SQLGetFunctions() *each time* you make a query? Can't you 
do that only when you connect to the database?

Anyway, I think I will try to make an emulation layer in the gb.db component, 
so that when a driver tells him that he cannot fetch into a result set, the 
component will emulate this behaviour, by storing the data itself.

And to keep the possibility of not storing the result of a query, maybe I 
should create a "forward-only" Result object.

Regards,

-- 
Benoit Minisini





More information about the Devel mailing list