comp.lang.ada
 help / color / mirror / Atom feed
From: soychangoman@gmail.com
Subject: GNADE/ODBC connection problem
Date: Fri, 3 Oct 2008 06:14:52 -0700 (PDT)
Date: 2008-10-03T06:14:52-07:00	[thread overview]
Message-ID: <b1f9ff35-fa52-4fbc-8d24-90842b02e411@y71g2000hsa.googlegroups.com> (raw)

I'm trying to use GNADE to connect to a MySQL database but i keep
getting the same error:

raised GNU.DB.SQLCLI.DRIVER_ERROR :
[Proc=SQLConnect][Server=][State=IM002][unixODBC][Driver Manager]Data
source name not found, and no default driver specified

I'm using Debian Sid with and amd64 architecture.

This is the code I'm trying to run:

--------------------------------------------
with Ada.Strings.Unbounded;
use Ada.Strings.Unbounded;

with GNU.DB.SQLCLI;
use GNU.DB.SQLCLI;

with GNU.DB.SQLCLI.Environment_Attribute;
use GNU.DB.SQLCLI.Environment_Attribute;



procedure sql_test_2 is

EnvironmentHandle : SQLHENV;
ConnectionHandle : SQLHDBC;

DSN : Unbounded_String := To_Unbounded_String("gnade");
UserName : Unbounded_String := To_Unbounded_String("gnade");
Password : Unbounded_String := To_Unbounded_String("gnade");


begin

SQLAllocHandle (
SQL_HANDLE_ENV,
SQL_NULL_HANDLE,
EnvironmentHandle
);

SQLSetEnvAttr (
EnvironmentHandle,
Environment_Attribute_ODBC_Version'
(Attribute => SQL_ATTR_ODBC_VERSION,
Value => SQL_OV_ODBC3)
);

SQLAllocHandle (SQL_HANDLE_DBC, EnvironmentHandle, ConnectionHandle);



SQLConnect(ConnectionHandle => ConnectionHandle,
ServerName => To_String(DSN),
UserName => To_String(UserName),
Authentication => To_String(Password));


end sql_test_2;
---------------------------------------------

The "gnade" database does exists and I have installed almost all the
drivers I could find.

Thanks

Matías Niklison



             reply	other threads:[~2008-10-03 13:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-03 13:14 soychangoman [this message]
2008-10-03 13:57 ` GNADE/ODBC connection problem Ludovic Brenta
2008-10-03 15:39   ` soychangoman
2008-10-04 20:54 ` Maciej Sobczak
2008-10-05  7:07   ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox