CodeIgniter Forums
Connection problem with sqlsrv - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Connection problem with sqlsrv (/showthread.php?tid=44702)



Connection problem with sqlsrv - El Forum - 08-24-2011

[eluser]Unknown[/eluser]
Hi,
I have a problem with connecting microsoft sql server. I can connect to microsoft sql server by using odbc with these options:

Code:
$db['default']['hostname'] = 'DRIVER={SQL Server};SERVER=BLLIM;DATABASE=DBV14';
$db['default']['username'] = '';
$db['default']['password'] = '';
$db['default']['database'] = 'DBV14';
$db['default']['dbdriver'] = 'odbc';


However, when i tried to connect by using sqlsrv with these similar options:

Code:
$db['default']['hostname'] = 'BLLIM';
$db['default']['username'] = '';
$db['default']['password'] = '';
$db['default']['database'] = 'DBV14';
$db['default']['dbdriver'] = 'sqlsrv';

i got this: "Unable to connect to your database server using the provided settings.".

I tried this on ci 2.0.3 . Please help Smile .


Connection problem with sqlsrv - El Forum - 05-10-2012

[eluser]chris_rey[/eluser]
:cheese:[quote author="afezer" date="1314187545"]Hi,
I have a problem with connecting microsoft sql server. I can connect to microsoft sql server by using odbc with these options:

Code:
$db['default']['hostname'] = 'DRIVER={SQL Server};SERVER=BLLIM;DATABASE=DBV14';
$db['default']['username'] = '';
$db['default']['password'] = '';
$db['default']['database'] = 'DBV14';
$db['default']['dbdriver'] = 'odbc';


However, when i tried to connect by using sqlsrv with these similar options:

Code:
$db['default']['hostname'] = 'BLLIM';
$db['default']['username'] = '';
$db['default']['password'] = '';
$db['default']['database'] = 'DBV14';
$db['default']['dbdriver'] = 'sqlsrv';

i got this: "Unable to connect to your database server using the provided settings.".

I tried this on ci 2.0.3 . Please help Smile .

[/quote] thanx to ur post i was able to connect with mssql using odbc :cheese: but may i ask, what's the difference between using odbc and sqlsrv?
thnx for this again afezer :-)