[Gambas-user] [Gambas Bug Tracker] Bug #1113: ODBC driver problem: driver connects but does not exec query
bugtracker at ...3416...
bugtracker at ...3416...
Mon Jun 5 23:08:39 CEST 2017
http://gambaswiki.org/bugtracker/edit?object=BUG.1113&from=L21haW4-
PICCORO LENZ MCKAY reported a new bug.
Summary
-------
ODBC driver problem: driver connects but does not exec query
Type : Bug
Priority : High
Gambas version : 3.9.90 (TRUNK)
Product : ODBC driver
Description
-----------
The following simple code does not execute, when used a driver different rather than Mysql odbc driver module for ODBC type connections:
Public Sub Main()
Dim $con As New Connection
Try $con.Close() '
$con.Type = "odbc" '
$con.Host = "testdb" '
$con.Login = "" '
$con.Password = "" '
$con.Open() '
Try $con.Exec("CREATE TABLE IF NOT EXISTS tabla1 ( columna1 VARCHAR(20), columna2 VARCHAR(20))")
Print Error.Text
End
If the ODBC connection tipe are using a ODBC mysql driver the code will work, but with any other type will fails always, i tested in each gambas version since 3.5, tested with 3.4 and 3.8 and 3.9 and trunk
the connection string are tested, the ODBC definition are globally at the /etc/odbc.ini and its:
[testdb]
Description=Mysql3
Driver=SQLite3
Database=/home/systemas/TEST
# optional lock timeout in milliseconds
Timeout=2000
the connection was tested and working sucessfully with UnixODBC isql command line tool:
isql testdb
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> CREATE TABLE IF NOT EXISTS tabla1 ( columna1 TEXT, columna2 TEXT)
SQLRowCount returns 0
SQL> select * from tabla1
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| columna1 | columna2 |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
SQLRowCount returns 0
SQL> DROP TABLE tabla1
SQLRowCount returns 0
SQL>
the Gambas code due driver implementation does not return why get and error, in second comment i attached image for gambas ide variables in execution
System information
------------------
[System]
Gambas=3.9.1
OperatingSystem=Linux
Kernel=2.6.38-bpo.2-686
Architecture=x86
Distribution=<hostname> 6.1
Desktop=
Theme=Gtk
Language=es_VE.UTF-8
Memory=2958M
[Libraries]
Cairo=libcairo.so.2.11000.2
Curl=libcurl.so.4.2.0
DBus=libdbus-1.so.3.4.0
GStreamer=libgstreamer-0.10.so.0.27.0
GTK+2=libgtk-x11-2.0.so.0.2000.1
Poppler=libpoppler.so.5.0.0
QT4=libQtCore.so.4.7.4
SDL=libSDL-1.2.so.0.11.4
SQLite=libsqlite3.so.0.8.6
[Environment]
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-vBmVAKTmAe,guid=ab802896e9e02a1f9130b5430000020a
DESKTOP_SESSION=openbox
DISPLAY=:0.0
GB_GUI=gb.qt4
GDMSESSION=openbox
GDM_LANG=es_VE.UTF-8
GDM_XSERVER_LOCATION=local
HOME=<home>
LANG=es_VE.UTF-8
LOGNAME=<user>
ORBIT_SOCKETDIR=/tmp/orbit-<user>
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
PWD=<home>
SHELL=/bin/bash
SSH_AGENT_PID=3169
SSH_AUTH_SOCK=/tmp/ssh-ufENJB3126/agent.3126
TZ=:/etc/localtime
USER=<user>
USERNAME=<user>
WINDOWPATH=7:7:7:7
XAUTHORITY=<home>/.Xauthority
XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/
XDG_MENU_PREFIX=lxde-
XDG_SESSION_COOKIE=e95ad835c51ba625379e246200000423-1494956351.268990-1110310328
More information about the User
mailing list