Welcome Guest, Not a member yet? Register   Sign In
MsSql connexion[SOLVED]
#1

[eluser]Belou[/eluser]
Hi everybody,
First , sorry for my bad english but my mother language is french.
I try to connect manually to a MSSQL server's database like this :

Code:
$config['hostname'] = "host";
$config['username'] = "myusername";
$config['password'] = "mypassword";
$config['database'] = "mydatabase";
$config['dbdriver'] = "mssql";
$config['dbprefix'] = "";
$config['pconnect'] = FALSE;
$config['db_debug'] = TRUE;
$config['cache_on'] = FALSE;
$config['cachedir'] = '';
$config['char_set'] = 'utf8';
$config['dbcollat'] = 'utf8_general_ci';
$this->load->database($config);
And :
An Error Was Encountered
Invalid DB Connection String

I don't understand the problem , because i succeed to connect with a DSN but with DSN there isn't Active Reccord. And i can't connect with database.php because i need to parametrize the connexion according to parameters .
And it appears that is impossible to give parameters to the function database() like that :
Code:
$this->load->database('name',$config);
Can anyone help me .
Thanks .
#2

[eluser]Seppo[/eluser]
CI 1.6.1 has a bug when you pass an array to connect. It has been fixed for the next release. In the meanwhile, you can go to system/database/DB.php and change line 49
Code:
}
    else
    {

to this

Code:
}
    elseif (is_string($params))
    {

edit: also, the array must be the first parameter. Take a look here
#3

[eluser]Belou[/eluser]
thanks Seppo it works!




Theme © iAndrew 2016 - Forum software by © MyBB