[Gambas-user] ODBC - unable to fetch row
Benoît Minisini
g4mba5 at gmail.com
Fri Jan 22 15:17:38 CET 2021
Le 22/01/2021 à 15:13, KKing a écrit :
> So my original issue may be related to mdbtools and debian in that most
> doco suggests the odbc.ini Driver setting should relate to the section
> name in /etc/odbcinst.ini in Debian mdbtools standard install would be
> [MDBTools] but this fails with isql and only works if the odbc.ini
> Driver setting points to the actual driver file in
> /usr/lib/..../libmdbodbc.so
> I am guessing the Gambas odbc component is not coping with this... will
> try to look into the gb.db.odbc code.
>
> But I also have a another odbc question. While trying to test out if it
> is more mdbtools and or debian I have setup a test to point to a sqlite
> db via odbc (yes I know gambas can go direct)
> isql select * from sampleTable returns 1,000 records ... but the
> following Gambas code only returns the first record?
>> Dim $con As New Connection
>> Dim intCount As Integer
>> Dim rs As Result
>> Dim $ExecCmd As String
>>
>> Try $con.Close()
>> $con.Type = "odbc"
>> $con.Host = "mysqlitedb"
>> $con.Open()
>>
>> $ExecCmd = "SELECT * FROM sampleTable "
>>
>> rs = $con.Exec($ExecCmd)
>>
>> intCount = rs.Count
>>
>> While (rs.Available)
>> Print "s_seq:" & rs!s_seq
>> rs.MoveNext
>> Wend
>>
>
It's hard for me to help, as I don't know ODBC and didn't write the driver.
But I know that the ODBC driver exposes many ways of browsing the result
of a query, and I guess the failure is related to that. Maybe failing to
use the accurate request browsing method, and/or detecting the end of
the query result list... ?
--
Benoît Minisini
More information about the User
mailing list