# ADABASD / odbcunix / php

**URL:** <https://techcommunity.softwareag.com/t/adabasd-odbcunix-php/58301>\
**Category:** Forum\
**Tags:** Adabas-Natural, Adabas, Adabas-on-Windows-UNIX, Adabas-Add-on-Products, Adabas-D\
**Created:** [May 30, 2007, 5:01pm UTC](https://techcommunity.softwareag.com/t/adabasd-odbcunix-php/58301 "2007-05-30T17:01:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![floppp](https://avatars.discourse-cdn.com/v4/letter/f/ac91a4/32.png) [@floppp](https://techcommunity.softwareag.com/u/floppp)\
**Post date:** [May 30, 2007, 5:01pm UTC](https://techcommunity.softwareag.com/t/adabasd-odbcunix-php/58301/1 "2007-05-30T17:01:24Z")

</div>

Hi,

I try to made a connection beetween a linux web server and a linux adabasD server.

I use a PHP odbc module which use odbcunix connection.

This my odbc configuration:  
aribo:/home/jmangeard# cat /etc/odbc.ini  
[myadabas]  
Description=My adabas  
Driver=adabas  
ServerDB=toto  
ServerNode=monserveurdetest  
SqlMode=ANSI  
IsolationLevel=Uncommited  
TraceFileName=sampldb.pct

aribo:/home/jmangeard# cat /etc/odbcinst.ini  
[adabas]  
Description = adabas  
Driver = /usr/local/adabas/lib/odbclib.so

[ODBC]  
Trace = Yes  
TraceFile = /tmp/sql.log  
ForceTrace = Yes  
Pooling = Yes

My PHP script:

$dsn = “DRIVER={adabas};SERVER=mytestserver;DATABASE=myadabas;UID=ODBC;”;  
$conn = odbc\_connect($dsn, $db\_user, $db\_pass);

Php output :  
aribo:/home/jmangeard# php test.php

Warning: odbc\_connect(): SQL error: , SQL state 00000 in SQLConnect in /home/jmangeard/test.php on line 7

The odbc log file:  
[ODBC][14216][SQLDriverConnect.c][678]  
Entry:  
Connection = 0x86460e0  
Window Hdl = (nil)  
Str In = [DRIVER={adabas};SERVER=bmytestserver;DATABASE=myadabas;UID=ODBC;][length = 75]  
Str Out = 0xaf80883a  
Str Out Max = 1023  
Str Out Ptr = 0xaf808c3a  
Completion = 0  
UNICODE Using encoding ASCII ‘ISO8859-1’ and UNICODE ‘UCS-2LE’

[ODBC][14216][SQLDriverConnect.c][1258]  
Exit:[SQL\_ERROR]  
[ODBC][14216][SQLError.c][424]  
Entry:  
Connection = 0x86460e0  
SQLState = 0xaf8087de  
Native = 0xaf8087e4  
Message Text = 0xaf8085de  
Buffer Length = 511  
Text Len Ptr = 0xaf8087ea  
[ODBC][14216][SQLError.c][461]  
Exit:[SQL\_NO\_DATA]  
[ODBC][14216][SQLFreeHandle.c][268]  
Entry:  
Handle Type = 2  
Input Handle = 0x86460e0  
[ODBC][14216][SQLFreeHandle.c][317]  
Exit:[SQL\_SUCCESS]

Can you help me ?  
This forum is my last chance to solve this problem. I have search a long time a solution to this problem on the web, but it seams to me that anyone used adabaseD with PHP or unix odbc.

---

<div class="post-metadata">

**Author:** ![Richard\_Kania](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@Richard\_Kania](https://techcommunity.softwareag.com/u/Richard_Kania)\
**Post date:** [June 8, 2007, 9:53am UTC](https://techcommunity.softwareag.com/t/adabasd-odbcunix-php/58301/2 "2007-06-08T09:53:02Z")

</div>

shouldn’t the “serverdb” match the value for “Database”? (they’re either both “toto” or both “myadabas”). The same for servernode and server (eg. both “bmytestserver” or both “monserveurdetest”)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:39pm UTC](https://techcommunity.softwareag.com/t/adabasd-odbcunix-php/58301/3 "2021-04-02T14:39:10Z")

</div>


