Part of the EllisLab Network
   
 
sqlsrv-driver in CI 2.1.0
Posted: 24 November 2011 04:29 AM   [ Ignore ]  
Summer Student
Total Posts:  3
Joined  08-26-2011

there are some problems while connecting CI 2.1.0 to Microsoft SQL-Server. The driver have some errors and did not return the correct value when trying in pconnect.

Perhaps you can try this patched driver:

File Attachments
sqlsrv.zip  (File Size: 13KB - Downloads: 165)
Profile
 
 
Posted: 03 January 2012 03:38 PM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  7
Joined  06-28-2010

thank you,it what was i need.
tell me, what is wrong in original ci driver?

Profile
 
 
Posted: 30 January 2012 01:03 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  10
Joined  01-24-2012

Thanks, Dumbledore.

That has saved me heaps of time.  Has this new code been submitted to the development team for incorporation into CodeIgniter?

I downloaded CI 2.1.0 on Friday, and the connect still does not work without the supplied fix - copy the files to system/database/drivers/sqlsrv.

For example purposes, this is what worked for me in database.php ..

$active_group 'dwh';

/* SQL Server - data warehouse - read */
$db['dwh']['hostname''maittestsql\testsql2008';
// $db['dwh']['hostname'] = 'maittestsql';
// $db['dwh']['port']     = 2646;        // no good - use server/instance instead
$db['dwh']['username''dwh';
$db['dwh']['password''password';
$db['dwh']['database''mydb';
$db['dwh']['dbdriver''sqlsrv';
$db['dwh']['dbprefix''';
$db['dwh']['pconnect'TRUE;
$db['dwh']['db_debug'TRUE;
$db['dwh']['cache_on'FALSE;
$db['dwh']['cachedir''';
$db['dwh']['char_set''utf8';
$db['dwh']['dbcollat''utf8_general_ci';
$db['dwh']['swap_pre''';
$db['dwh']['autoinit'TRUE;
$db['dwh']['stricton'FALSE

 

Profile
 
 
Posted: 06 February 2012 10:26 AM   [ Ignore ]   [ # 3 ]  
Summer Student
Avatar
Total Posts:  3
Joined  02-06-2012

Thanks for your work!

Does it require to install some others applications to make it work?

My server is actually running a Debian distribution…

Thanks for your help.

Fanch

Profile
 
 
Posted: 06 February 2012 04:51 PM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  10
Joined  01-24-2012

I used the ‘sqlsrv’ driver supplied by Microsoft.
http://www.microsoft.com/download/en/confirmation.aspx?id=17308 (version 3)
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=20098 (version 2)

These are .dll files, though, so presumably this is only available for Windows.

Maybe go for the ‘mssql’ drivers on Debian ?

Profile
 
 
Posted: 07 February 2012 12:47 PM   [ Ignore ]   [ # 5 ]  
Summer Student
Avatar
Total Posts:  3
Joined  02-06-2012

Thanks Tybion,

I’ve had to install sybase and freedts (i’m running PHP Version 5.3.6-13ubuntu3.3):

sudo apt-get install libsybdb5 freetds-common php5-sybase
sudo 
/etc/init.d/apache2 restart 

Once installed you can check in phpinfo() answers that the installation was effective.

Thanks to all for your brillant work, CodeIgniter rules!

Profile