Welcome Guest, Not a member yet? Register   Sign In
A little issue with Sybase [SOLVED]
#1

[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.
#2

[eluser]FastPhoto[/eluser]
Hello,
I just upgraded to CI 2.1 from 1.7.2. Did it with fresh install and I think I made a few tweaks to ODBC to be able to connect to SQLA v.12. But now with 2.1.0 I can't any longer. Existing code is failing on an active record call to order by.

Code:
echo "where done";
     $DB1->orderby('Name');
echo "orderby done";
Are you still having success with your DB driver and the latest versions?

I have been using the ODBC as I haven't seen a SQLA driver built into SQLA.

Thanks.

David




Theme © iAndrew 2016 - Forum software by © MyBB