phpLens
 home  products examples manual  faq support forum  contact news  login store

Forums: phplens   adodb
Forum:   ADOdb Help & Dev
author's name*
email*
topic*
body*
To help us reduce spam, please enter the text in the picture above

You can enter the following UBB tags: [b]bold[/b], [i]italic[/i], [red]red[/red] and [pre] [/pre]

Topic: MSSQLNative and MultipleActiveResultSets
author: Bill Thousand   created: 30-04-2012 09:48:06 AM
We have been experimenting with the new MSSQLNative driver and have determined that we need to add the parameter 'MultipleActiveResultSets'=>'0' to the connection info in order to get our application to be compatible.

In order to get that to work, I changed it in the driver code.

Is there some better way to get this into the connection info?

Thanks!
Topic: Re:MSSQLNative and MultipleActiveResultSets
author: John Lim   created: 01-05-2012 11:37:58 PM
Hi, Can i have your code modifications. TQ, John
Topic: Re:MSSQLNative and MultipleActiveResultSets
author: John Lim   created: 01-05-2012 11:44:43 PM
Never mind. I figured it out. I have changed code to work as follows. Call this before you connect:

$db->connectionInfo['MultipleActiveResultSets'] = 0;
$db->Connect($host, $userid, $pwd, $db);


To implement, add following variable to the adodb-mssqlnative connection class:


var $connectionInfo = array();

Then in the connect function you define:


function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
{
if (!function_exists('sqlsrv_connect')) return null;

$connectionInfo = $this->connectionInfo;
$connectionInfo["Database"]=$argDatabasename;
$connectionInfo["UID"]=$argUsername;
$connectionInfo["PWD"]=$argPassword;

if ($this->debug) error_log("<hr>connecting... hostname: $argHostname params: ".var_export($connectionInfo,true));
//if ($this->debug) error_log("<hr>_connectionID before: ".serialize($this->_connectionID));
if(!($this->_connectionID = sqlsrv_connect($argHostname,$connectionInfo))) {
if ($this->debug) error_log( "<hr><b>errors</b>: ".print_r( sqlsrv_errors(), true));
return false;
}
//if ($this->debug) error_log(" _connectionID after: ".serialize($this->_connectionID));
//if ($this->debug) error_log("<hr>defined functions: <pre>".var_export(get_defined_functions(),true)."</pre>");
return true;
}
Topic: Re:MSSQLNative and MultipleActiveResultSets
author: Bill Thousand   created: 03-05-2012 02:43:39 PM
Thanks John. That works great!

View Source

email: contact#phplens.com (change # to @)     telephone (malaysia): 60-3-7947 2888     fax (malaysia): 60-3-7947 2800