[eluser]timtheelephant[/eluser]
Hi all, I wrote a Sybase driver using the sasql module. I'm using IIS and SQL Anywhere 10. My problem is that the database autoloads without error, but when I actually try to run a query, I get an error saying
Code:
Login mode 'Integrated' not permitted by login_mode setting
My connection string has the username and password in it, and if I take them out it gives an error upon attempting to autoload the database, so something odd is going on here. The model itself loads and constructs fine. Code follows:
database.php
Code:
$db['default']['hostname'] = 'Uid=dba;Pwd=sql;
ServerName=demo10;
DatabaseName=db10_local;
DatabaseFile=C:\db10_local.db;
Links=tcpip(host=localhost)';
main.php (controller)
Code:
...
public function Load_Login()
{
$this->load->model('login');
$this->login->check_login('t','d');
}
...
login.php (model)
Code:
class Login extends CI_Model {
public function __construct()
{
parent::__construct();
}
/*
* Verifies login credentials
* ...
*/
public function check_login($username,$password)
{
$username = trim($username);
$password = trim($password);
$query = 'SELECT TOP 100 * FROM d_user_directory';
$res = $this->db->query($query, Array($username,$password));
print_r($res->result_array());
}
...
}
Code:
A Database Error Occurred
Error Number:
Login mode 'Integrated' not permitted by login_mode setting
SELECT TOP 100 * FROM d_user_directory
Filename: C:\inetpub\wwwroot\d\system\database\DB_driver.php
Line Number: 330
Any help would be appreciated, as this is a little bit confusing. Thanks!
Edit:
The problem was some previous debugging I was doing in the Sybase driver. sasql_error() resets the connection resource, so it didn't actually have a valid resource. Whoops.