Welcome Guest, Not a member yet? Register   Sign In
Windows XP, WAMP, PHP 5.3, MS SQL 2008, CI, NO ODBC! [solved]
#1

[eluser]imorris[/eluser]
We've struggled mightly with how to setup a CI connection to MS SQL 2008 (without ODBC) and we finally have it figured out. There are no step-by-step instructions available on the internet on how to set it all up so I've decided to put them here.

1 - SQLSRV20.EXE (Google it and download from MS) is a self extracting zip that gives you access to the necessary .dll. Run SQLSRV20.EXE and note the extraction folder. Copy the extracted file php_sqlsrv_53_ts_vc6.dll to C:\wamp\bin\php\php5.3.0\ext

2 - Edit your PHP.ini file to include the extension php_sqlsrv_53_ts_vc6.dll. For example:
extension = php_sqlsrv_53_ts_vc6.dll

3 - The Microsoft SQL Server 2008 Native Client is required for a successful database connection. Install this file from Microsoft: sqlncli.msi (Another Google and download)

4 - Restart All of your WAMP services.

5 - Extract and copy the three files from: http://www.phrenzy.org/code/sqlsrv-1.1.tar.gz

6 - Paste them into your project under {Project_Name}/system/database/drivers/sqlsrv. If the sqlsrv directory doesn't exist, then create it.

7 - Configure your {Project_Name}/system/application/config/database to look as follows:
$db['default']['hostname'] = "servername";
$db['default']['username'] = "username";
$db['default']['password'] = "password";
$db['default']['database'] = "databasename";
$db['default']['dbdriver'] = "sqlsrv";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

---------------------
Credit for three Code Igniter driver files goes to these sites:

http://www.kaweb.co.uk/blog/mssql-server...deigniter/
http://www.phrenzy.org/code/sqlsrv-1.1.tar.gz (We actually used this page's files)
#2

[eluser]pickupman[/eluser]
Great tip. I am sure there are a number of people who could use this. This could help with some problems users experience setting up system DSNs for their ODBC connections.

Have you tested speed of queries between direct vs ODBC?
#3

[eluser]imorris[/eluser]
[quote author="pickupman" date="1292022426"]Great tip. I am sure there are a number of people who could use this. This could help with some problems users experience setting up system DSNs for their ODBC connections.

Have you tested speed of queries between direct vs ODBC?[/quote]

We've not done speed testing, but I can tell you our basic select statements are pulling data instantaneously.
#4

[eluser]SecretAgentX9[/eluser]
I use Zend Server CE w/ PHP 5.3 & Apache on Windows and I also got it working using your fix so I thought I'd share how I did it since it took me a while to figure it out.

When you install ZS choose 'custom' on the installation options and enable support for Windows SQL Server.

Go to: C:\Program Files\Zend\ZendServer\etc and open php.ini.
At the bottom of the file in the space below 'extension=php_win32service.dll' I added 'extension=php_sqlsrv.dll' (no quotes)

Restart PHP from the Zend Console.

Then follow the rest of the steps (3, 5, 6, 7)




Theme © iAndrew 2016 - Forum software by © MyBB