Welcome Guest, Not a member yet? Register   Sign In
Connect to SAP HANA using ODBC Driver
#1

Hi Masters,


Does anyone of you had successfully made a connection to SAP HANA using ODBC driver?

Here's my database configuration:



$db['hana_db'] = array(
    'dsn'    => '',
    'hostname' => 'Driver={HDBODBC32};ServerNode=192.168.0.***:3**15;UID=******;PWD=********;Database= *****;',
    'username' => '*****',
    'password' => '*****',
    'dbdriver' => 'odbc',
    'database' => '*****',

);


But then I got a PHP error

Severity: Warning
Message: odbc_exec(): SQL error: [SAP AG][LIBODBCHDB32 DLL][HDB] General error;-10808 Feature (SCROLLABLE RESULT) not implemented yet in module: d:\depot\bas\IMP\NewDB100_REL\src/sys/src, SQL state S1000 in SQLExecDirect
Filename: odbc/odbc_driver.php
Line Number: 138


Need your help on this,

Thanks
Reply
#2

Have you tried to change ODBC driver configuration and set the cursor type to a forward only cursor ?
Reply
#3

(06-21-2016, 07:27 AM)Alphen Wrote: Have you tried to change ODBC driver configuration and set the cursor type to a forward only cursor ?

Got it working by changing the odbc_driver.php file

public function db_connect($persistent = FALSE)
    {
        return ($persistent === TRUE)
            ? odbc_pconnect($this->dsn, $this->username, $this->password, SQL_CUR_USE_ODBC)
            : odbc_connect($this->dsn, $this->username, $this->password, SQL_CUR_USE_ODBC);
    }


Thanks Bro, Great help!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB