[Gambas-user] ODBC - unable to fetch row

KKing kicking177 at gmail.com
Thu Jan 21 11:16:11 CET 2021


In Debian 10 with Gambas 3.12.2 from Debian repo I have a user based 
.odbc.ini containing
> [MyTest]
> Description = MyTest
> Driver=/usr/lib/x86_64-linux-gnu/odbc/libmdbodbc.so
> Servername = localhost
> Database = /home/user01/Northwind.mdb
> Name =
> Password =
> port = 5432

and from a bash prompt (outside of Gambas) I can
> $ isql -v mytest
> +---------------------------------------+
> | Connected!                            |
> |                                       |
> | sql-statement                         |
> | help [tablename]                      |
> | quit                                  |
> |                                       |
> +---------------------------------------+
> SQL> select * from shippers
> +------------+-----------------------------------------+-------------------------+
> | ShipperID  | CompanyName                             | 
> Phone                   |
> +------------+-----------------------------------------+-------------------------+
> | 1          | Speedy Express                          | (503) 
> 555-9831          |
> | 2          | United Package                          | (503) 
> 555-3199          |
> | 3          | Federal Shipping                        | (503) 
> 555-9931          |
> +------------+-----------------------------------------+-------------------------+
> SQLRowCount returns 3
> 3 rows fetched
> SQL> 

BUT when I start a new gambas project (using gb.db and gb.db.odbc) with 
only this code
>   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 = "mytestb"
>   $con.Open()
>   $ExecCmd = "SELECT * FROM Shippers "
>   rs = $con.Exec($ExecCmd)
>   intCount = rs.Count

I get error on the $con.Exec line of
> unable to fetch row
what am I missing of failed to do to allow Gambas to interact with?
K.







More information about the User mailing list