Hallo,

I was currently happy now, to get the most of my compiled linux
environment working like an orchestra.

Ada is a funny language. I developed it many years ago. So I try to
install a good developer  environment

on my computer.


Current problem description...

GPS 4.2.1 is running well.

QT 4.5 was compiled new, and it seems to work properly with all
qt-tutorials 1-12.

qtada 2.2.0 was compiled and installed without further problems.

postgresql 8.3.6 was compiled and installed without further problems.
$psql works for testuser "dba" and its testpassword "xxx".

unixODBC 1.5.3a-7 was compiled and installed without further problems.

I tested the odbc- connection with $isql. It works well. I can do any
for me necessary SQL-Commands.

Now I thought stupidly and tried to realize a SQL-Connection to my
database postgresql via qtada. BIG Problem!

I've checked the sql.log, created by odbc-driver, too. Here was no error
registered.

The compilation of my Ada-Code was done without any errors.

If I start my program, it stops everytime at the line, where the
Database will be tried to be opened.

Now, I give up to searching in the web, because there are only less
public examples about this combination

of developer environment.

You are my last hope.

It will help me much, if you can give me a constructive hint, which my
problem could solve, so that I can connect

to my postgres-database via qtada/odbc-interface with all the
possibilities of QT-sql.

QTelse seems to work properly with qtada. The tutorials makes no problems.


Many thanks for giving feedback.

Best wishes,

Benjamin Kravanja





*-- My Ada-Code "main.adb" for a first testing of urgent necessary
interfaces*
with Ada.Text_IO; use Ada.Text_IO;

with Qt_Ada.Application;

with Qt4.Strings;
with Qt4.Push_Buttons.Constructors;

with Qt4.Sql_Databases;
with Qt4.Sql_Queries;


procedure main is


begin
   qt_ada.application.initialize;

   declare
      db    : qt4.Sql_Databases.Q_Sql_Database;

      query :  constant qt4.sql_queries.q_sql_query
            := qt4.sql_queries.create(db);

      hello :  constant not null access qt4.push_buttons.q_push_button'class
            := qt4.push_buttons.constructors.create
               ( qt4.strings.from_utf_16( "Hello world!" ) );
   begin

      db    := qt4.sql_databases.add_database( qt4.strings.from_utf_16(
"QODBC" ) );


      db.set_database_name( qt4.strings.from_utf_16( "mydb" ) );
      db.set_user_name( qt4.strings.from_utf_16( "dba" ) );
      db.set_password( qt4.strings.from_utf_16( "xxx" ) );
--      db.set_host_name( qt4.strings.from_utf_16( "bknb" ) );
--      db.Set_Port( qt4.Q_Integer( 5432 ) );

      if ( not db.open )then
         raise Program_Error;
      end if;
put( "execute query" );
      query.exec( qt4.strings.from_utf_8
                  ( "create table abc ("
                    & "id         int primary key,"
                    & "imagefile  int,"
                    & "location   varchar(20),"
                    & "country    varchar(20),"
                    & "description  varchar(100)"
                    & ")"
                  )
                );


   hello.resize (100, 30);
   hello.show;

   qt_ada.application.execute;

   end;

end main;



*-- My Project-File "main.gpr"*
with "/opt/qtada/lib/gnat/qt_core.gpr";
with "/opt/qtada/lib/gnat/qt_designer.gpr";
with "/opt/qtada/lib/gnat/qt_gui.gpr";
with "/opt/qtada/lib/gnat/qt_sql.gpr";
with "/opt/qtada/lib/gnat/qt_ui_tools.gpr";
--with "/opt/gtkada/lib/gnat/gtkada.gpr";
--with "/opt/gtkada/lib/gnat/gtkada_gnome.gpr";
--with "/opt/gtkada/lib/gnat/gtkada_gl.gpr";
--with "/opt/gtkada/lib/gnat/gtkada_glade.gpr";
--with "/opt/gnat/lib/gnat/aws/aws_xmlada.gpr";
--with "/opt/gnat/lib/gnat/aws/aws_ssl_support.gpr";
--with "/opt/gnat/lib/gnat/aws/aws_ssl_shared.gpr";
--with "/opt/gnat/lib/gnat/aws/aws_ssl_lib.gpr";
--with "/opt/gnat/lib/gnat/aws_ssl.gpr";
--with "/opt/gnat/lib/gnat/aws/aws_ssl_error_lib.gpr";
--with "/opt/gnat/lib/gnat/aws/aws_shared.gpr";
--with "/opt/gnat/lib/gnat/aws/aws_libz.gpr";
--with "/opt/gnat/lib/gnat/aws.gpr";
--with "/opt/gnat/lib/gnat/aws/aws_crypto_lib.gpr";
--with "/opt/gnat/lib/gnat/aws/aws_config.gpr";
--with "/opt/gnat/lib/gnat/aws/aws_components.gpr";
--with "/opt/aunit/lib/gnat/aunit.gpr";
--with "/opt/gnat/lib/gnat/asis.gpr";

project main is

   for Source_Dirs use (".");
   for Object_Dir use ".obj";
   for Exec_Dir use ".";
   for Main use ("main.adb");

   package Builder is
      for Default_Switches ("ada") use ("-g");
   end Builder;

   package Compiler is
      for Default_Switches ("ada") use ("-g", "-gnatf", "-gnat05",
"-gnata");
   end Compiler;

   package Binder is
      for Default_Switches ("ada") use ("-g", "-F");
   end Binder;

end main;

*-- Linux-Environments*
ACLOCAL_FLAGS=-I /opt/gnome/share/aclocal
ADA_INCLUDE_PATH=:/usr/local/gnade/include
ADA_OBJECTS_PATH=:/lib/aunit:/usr/local/gnade/include:/opt/qtada/lib/qtada:/opt/xmlada/lib/xmlada/relocatable
ADA_PROJECT_PATH=/opt/gnat/lib/gnat:/opt/gnat/lib/gnat/aws:/opt/aunit/lib/gnat:/usr/local/gnade/shared/gnade.gpr:/opt/gtkada/lib/gnat:/opt/qtada/opt/aunit/lib/gnat:/opt/xmlada/lib/gnat:/opt/xmlada/lib/gnat/xmlada
AUNIT_HOME=/opt/aunit
CLASSPATH=/home/server/project/INCLUDE/java:/home/user/root/project/INCLUDE/java:./
COLORTERM=1
CPU=i686
CSHEDIT=emacs
CVS_RSH=ssh
DISABLE_HUGETLBFS=1
DISPLAY=:0
ENV=/etc/bash.bashrc
FROM_HEADER=
GNADE_BASEPATH=/usr/local/gnade
GNADE_HOME=/usr/local/gnade
GNAT_HOME=/opt/gnat
GNAT_OME=/opt/gnat
GNOME2_PATH=/usr/local:/opt/gnome:/usr
GNOMEDIR=/usr
GNOME_PATH=:/usr
GPS_DOC_PATH=/usr/local/gnade/doc
GROFF_NO_SGR=yes
GTKADA_HOME=/opt/gtkada
GTK_PATH=/usr/local/lib/gtk-2.0:/usr/lib/gtk-2.0
G_BROKEN_FILENAMES=1
G_FILENAME_ENCODING=UTF-8
HISTFILE=/home/user/root/.bash_history.d/BKNB.root.0326
HISTFILESIZE=6000
HISTIGNORE=
HISTSIZE=2000
HOME=/home/user/root
HOST=bknb
HOSTNAME=BKNB
HOSTTYPE=i386
INFODIR=/usr/local/info:/usr/share/info:/usr/info
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/opt/gnome/share/info
INPUTRC=/etc/inputrc
JAVA_BINDIR=/opt/java/jdk/bin
JAVA_HOME=/opt/java/jdk
JAVA_ROOT=/opt/java/jdk
JDK_HOME=/opt/java/jdk
JRE_HOME=/opt/java/jdk/jre
LANG=POSIX
LC_CTYPE=en_US.UTF-8
LD_LIBRARY_PATH=:/lib:/usr/lib:/usr/local/lib:/usr/X11R6/lib:/opt/qt/current/lib:/opt/kde3/lib:/usr/local/lib/xine/plugins/1.22:/usr/local/gnade/lib:/opt/qt/current/plugins/sqldrivers:/opt/gnat/lib:/opt/aunit/lib:/usr/local/gnade/lib:/opt/gtkada/lib:/opt/qtada/lib:/opt/xmlada/lib:/opt/postgresql/lib:/opt/postgresql/8.3/lib:/opt/PostgreSQL/psqlODBC/lib
LESS=-M -I
LESSCLOSE=lessclose.sh %s %s
LESSKEY=/etc/lesskey.bin
LESSOPEN=lessopen.sh %s
LESS_ADVANCED_PREPROCESSOR=no
LIBXCB_ALLOW_SLOPPY_LOCK=1
LOADEDMODULES=
LOGNAME=root
LS_COLORS=no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:
LS_OPTIONS=-A -N --color=tty -T 0
MACHTYPE=i686-suse-linux
MAIL=/var/spool/mail/root
MANPATH=/usr/share/man:/usr/local/man:/usr/local/share/man:/opt/cross/share/man:/opt/mpich/man:/opt/snavigator/man
MINICOM=-c on
MODULEPATH=/usr/share/modules:/usr/share/modules/modulefiles
MODULESHOME=/usr/share/modules
MODULE_VERSION=3.1.6
MODULE_VERSION_STACK=3.1.6
MORE=-sl
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
NNTPSERVER=news
OLDPWD=/opt/qt/qt4
OSTYPE=linux
PAGER=less
PATH=/opt/gnat/bin:/mtc/sbin:/sbin:/usr/sbin:/usr/local/sbin:/mtc/bin:/usr/bin:/usr/X11R6/bin:/opt/gnome/bin:/usr/local/bin:/bin:/mtc/script:/opt/java/jdk/bin:/home/server/sun.wappserver/bin:/usr/games:/opt/kde3/bin:/opt/aunit/bin:/usr/local/gnade/bin:/opt/gtkada/bin:/opt/qtada/bin:/opt/xmlada/bin:/opt/postgresql/bin
PGDATA=/home/server/database/postgresql/data
PGHOME=/opt/postgresql
PGHOSTADDR=192.168.1.10
PGLOG=/home/server/database/postgresql/log
PGOPTIONS=
PGPORT=5432
PGUSER=root
PKG_CONFIG_PATH=/opt/gnome/lib/pkgconfig:/opt/gnome/share/pkgconfig
POSTGRES_HOME=/opt/postgresql
PROFILEREAD=true
PS1=\h#
PS2=>
PS3=#
PS4=+
PWD=/opt/qt
PYTHONSTARTUP=/etc/pythonstart
QTADA_HOME=/opt/qtada
QTCORE_LIBS=/opt/qt/qt4/lib
QTDIR=/opt/qt/qt4
QT_HOME=/opt/qt/qt4
QT_SYSTEM_DIR=/opt/qt/qt4/desktop-data
RANDFILE=/dev/urandom
RASMOLPATH=/usr/lib/rasmol
SDK_HOME=/home/server/sun.wappserver
SHELL=/bin/bash
SHLVL=4
SSLEAY_CONFIG=/etc/ssl/openssl.cfg
TEMP=/tmp
TERM=xterm
TEXINPUTS=:/home/user/root/.TeX:/usr/share/doc/.TeX:/usr/doc/.TeX
TMPDIR=/tmp
USER=root
WINDOWID=37748764
WINDOWMANAGER=/usr/X11R6/bin/kde
XCURSOR_THEME=crystalwhite
XDG_CONFIG_DIRS=:/etc/xdg
XDG_DATA_DIRS=/usr/local/share:/usr/share:/etc/opt/kde3/share:/opt/freeciv/share:/opt/gnome/share:/opt/kde3/share
XKEYSYMDB=/usr/share/X11/XKeysymDB
XMLADA_HOME=/opt/xmlada
XNLSPATH=/usr/share/X11/nls
XTERM_LOCALE=en_US.UTF-8
XTERM_SHELL=/bin/bash
XTERM_VERSION=X.Org 6.8.99.903(229)


*Runtime-Error of started code above
*execute queryQSqlQuery::exec: database not open
raised PROGRAM_ERROR : qt4-sql_queries.adb:424 explicit raise

*-- odbd - sql.txt*
[ODBC][366][1238082609.401937][__handles.c][450]
                Exit:[SQL_SUCCESS]
                        Environment = 0x8096128
[ODBC][366][1238082609.402038][SQLSetEnvAttr.c][182]
                Entry:
                        Environment = 0x8096128
                        Attribute = SQL_ATTR_ODBC_VERSION
                        Value = 0x2
                        StrLen = -5
[ODBC][366][1238082609.402068][SQLSetEnvAttr.c][349]
                Exit:[SQL_SUCCESS]
[ODBC][366][1238082609.402097][SQLAllocHandle.c][364]
                Entry:
                        Handle Type = 2
                        Input Handle = 0x8096128
[ODBC][366][1238082609.402136][SQLAllocHandle.c][482]
                Exit:[SQL_SUCCESS]
                        Output Handle = 0x80966f0
[ODBC][366][1238082609.402259][SQLDriverConnect.c][687]
                Entry:
                        Connection = 0x80966f0
                        Window Hdl = (nil)
                        Str In = [DSN=mydb;UID=dba;PWD=***][length = 24]
                        Str Out = 0xbfd712fc
                        Str Out Max = 1024
                        Str Out Ptr = 0xbfd71758
                        Completion = 0
                UNICODE Using encoding ASCII 'ISO8859-1' and UNICODE
'UCS-2LE'

[ODBC][366][1238082609.481025][SQLDriverConnect.c][1496]
                Exit:[SQL_SUCCESS]
                        Connection Out
[DSN=mydb;DATABASE=mydb;SERVER=;PORT=5432;UID=dba;PWD=sql;SSLmode...]
[ODBC][366][1238082609.481237][SQLGetFunctions.c][147]
                Entry:
                        Connection = 0x80966f0
                        Id = SQLDescribeCol
                        Supported = 0xbfd7129a
[ODBC][366][1238082609.481268][SQLGetFunctions.c][182]
                Exit:[SQL_SUCCESS]
                        Supported = 0xbfd7129a -> 1
[ODBC][366][1238082609.481296][SQLGetFunctions.c][147]
                Entry:
                        Connection = 0x80966f0
                        Id = SQLGetData
                        Supported = 0xbfd7129a
[ODBC][366][1238082609.481323][SQLGetFunctions.c][182]
                Exit:[SQL_SUCCESS]
                        Supported = 0xbfd7129a -> 1
[ODBC][366][1238082609.481350][SQLGetFunctions.c][147]
                Entry:
                        Connection = 0x80966f0
                        Id = SQLColumns
                        Supported = 0xbfd7129a
[ODBC][366][1238082609.481377][SQLGetFunctions.c][182]
                Exit:[SQL_SUCCESS]
                        Supported = 0xbfd7129a -> 1
[ODBC][366][1238082609.481412][SQLGetFunctions.c][147]
                Entry:
                        Connection = 0x80966f0
                        Id = SQLGetStmtAttr
                        Supported = 0xbfd7129a
[ODBC][366][1238082609.481440][SQLGetFunctions.c][182]
                Exit:[SQL_SUCCESS]
                        Supported = 0xbfd7129a -> 1
[ODBC][366][1238082609.481467][SQLGetFunctions.c][147]
                Entry:
                        Connection = 0x80966f0
                        Id = SQLGetDiagRec
                        Supported = 0xbfd7129a
[ODBC][366][1238082609.481549][SQLGetFunctions.c][182]
                Exit:[SQL_SUCCESS]
                        Supported = 0xbfd7129a -> 1
[ODBC][366][1238082609.481576][SQLGetFunctions.c][147]
                Entry:
                        Connection = 0x80966f0
                        Id = SQLGetInfo
                        Supported = 0xbfd7129a
[ODBC][366][1238082609.481609][SQLGetFunctions.c][182]
                Exit:[SQL_SUCCESS]
                        Supported = 0xbfd7129a -> 1
[ODBC][366][1238082609.481636][SQLGetFunctions.c][147]
                Entry:
                        Connection = 0x80966f0
                        Id = SQLTables
                        Supported = 0xbfd7129a
[ODBC][366][1238082609.481664][SQLGetFunctions.c][182]
                Exit:[SQL_SUCCESS]
                        Supported = 0xbfd7129a -> 1
[ODBC][366][1238082609.481691][SQLGetFunctions.c][147]
                Entry:
                        Connection = 0x80966f0
                        Id = SQLNumResultCols
                        Supported = 0xbfd7129a
[ODBC][366][1238082609.481718][SQLGetFunctions.c][182]
                Exit:[SQL_SUCCESS]
                        Supported = 0xbfd7129a -> 1
[ODBC][366][1238082609.481745][SQLGetFunctions.c][147]
                Entry:
                        Connection = 0x80966f0
                        Id = SQLRowCount
                        Supported = 0xbfd7129a
[ODBC][366][1238082609.481773][SQLGetFunctions.c][182]
                Exit:[SQL_SUCCESS]
                        Supported = 0xbfd7129a -> 1
[ODBC][366][1238082609.481839][SQLGetInfo.c][546]
                Entry:
                        Connection = 0x80966f0
                        Info Type = SQL_CONVERT_CHAR (56)
                        Info Value = 0xbfd71298
                        Buffer Length = 4
                        StrLen = (nil)
[ODBC][366][1238082609.481868][SQLGetInfo.c][608]
                Exit:[SQL_SUCCESS]
[ODBC][366][1238082609.481899][SQLGetInfo.c][546]
                Entry:
                        Connection = 0x80966f0
                        Info Type = SQL_CONVERT_VARCHAR (70)
                        Info Value = 0xbfd71298
                        Buffer Length = 4
                        StrLen = (nil)
[ODBC][366][1238082609.481927][SQLGetInfo.c][608]
                Exit:[SQL_SUCCESS]
[ODBC][366][1238082609.481957][SQLGetInfo.c][546]
                Entry:
                        Connection = 0x80966f0
                        Info Type = SQL_CONVERT_LONGVARCHAR (62)
                        Info Value = 0xbfd71298
                        Buffer Length = 4
                        StrLen = (nil)
[ODBC][366][1238082609.481984][SQLGetInfo.c][608]
                Exit:[SQL_SUCCESS]
[ODBC][366][1238082609.482023][SQLGetInfo.c][546]
                Entry:
                        Connection = 0x80966f0
                        Info Type = SQL_SCHEMA_USAGE (91)
                        Info Value = 0xbfd7129c
                        Buffer Length = 4
                        StrLen = (nil)
[ODBC][366][1238082609.482057][SQLGetInfo.c][608]
                Exit:[SQL_SUCCESS]
[ODBC][366][1238082609.482095][SQLGetInfo.c][546]
                Entry:
                        Connection = 0x80966f0
                        Info Type = SQL_DBMS_NAME (17)
                        Info Value = 0xbfd7127c
                        Buffer Length = 20
                        StrLen = 0xbfd71298
[ODBC][366][1238082609.482124][SQLGetInfo.c][608]
                Exit:[SQL_SUCCESS]




-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.qtada.com/pipermail/qtada-users_lists.qtada.com/attachments/20090326/522abdab/attachment.html>
_______________________________________________
qtada-users mailing list
[email protected]
http://lists.qtada.com/mailman/listinfo/qtada-users_lists.qtada.com

Reply via email to