<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: MSSQL Server 2005 and CodeIgniter</title>
	<atom:link href="http://www.kaweb.co.uk/blog/mssql-server-2005-and-codeigniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kaweb.co.uk/blog/mssql-server-2005-and-codeigniter/</link>
	<description>Kaweb</description>
	<lastBuildDate>Mon, 06 Sep 2010 15:14:22 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: mdrisser</title>
		<link>http://www.kaweb.co.uk/blog/mssql-server-2005-and-codeigniter/comment-page-1/#comment-583</link>
		<dc:creator>mdrisser</dc:creator>
		<pubDate>Mon, 09 Aug 2010 17:37:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.kaweb.co.uk/?p=110#comment-583</guid>
		<description>Just what the doctor ordered. Thank you very much. I agree with Kirven, hopefully this will make it into the main CI, or atleast be made easier to find :)</description>
		<content:encoded><![CDATA[<p>Just what the doctor ordered. Thank you very much. I agree with Kirven, hopefully this will make it into the main CI, or atleast be made easier to find <img src='http://www.kaweb.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gnoon</title>
		<link>http://www.kaweb.co.uk/blog/mssql-server-2005-and-codeigniter/comment-page-1/#comment-559</link>
		<dc:creator>gnoon</dc:creator>
		<pubDate>Fri, 16 Jul 2010 08:02:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.kaweb.co.uk/?p=110#comment-559</guid>
		<description>I just realized that only change above is not help. Still get the error message &#039;This function only works with statements that are not scrollable&#039; after called sqlsrv_rows_affected(), which means that SCROLLABLE should be determined during execute statement.

Here the final code

// will not specify scrollable if it&#039;s DML commands
function _execute($sql)
{
  $sql = $this-&gt;_prep_query($sql);
  if(stripos($sql,&#039;UPDATE&#039;) !== FALSE &#124;&#124; stripos($sql,&#039;INSERT&#039;) !== FALSE) {
    return sqlsrv_query($this-&gt;conn_id, $sql, null, array());
  }
  return sqlsrv_query($this-&gt;conn_id, $sql, null, array(
    &#039;Scrollable&#039; =&gt; SQLSRV_CURSOR_STATIC,
    &#039;SendStreamParamsAtExec&#039; =&gt; true
  ));
}
function affected_rows()
{
  return @sqlsrv_rows_affected($this-&gt;result_id);
}

Best regards,
Noon</description>
		<content:encoded><![CDATA[<p>I just realized that only change above is not help. Still get the error message &#8216;This function only works with statements that are not scrollable&#8217; after called sqlsrv_rows_affected(), which means that SCROLLABLE should be determined during execute statement.</p>
<p>Here the final code</p>
<p>// will not specify scrollable if it&#8217;s DML commands<br />
function _execute($sql)<br />
{<br />
  $sql = $this-&gt;_prep_query($sql);<br />
  if(stripos($sql,&#8217;UPDATE&#8217;) !== FALSE || stripos($sql,&#8217;INSERT&#8217;) !== FALSE) {<br />
    return sqlsrv_query($this-&gt;conn_id, $sql, null, array());<br />
  }<br />
  return sqlsrv_query($this-&gt;conn_id, $sql, null, array(<br />
    &#8216;Scrollable&#8217; =&gt; SQLSRV_CURSOR_STATIC,<br />
    &#8216;SendStreamParamsAtExec&#8217; =&gt; true<br />
  ));<br />
}<br />
function affected_rows()<br />
{<br />
  return @sqlsrv_rows_affected($this-&gt;result_id);<br />
}</p>
<p>Best regards,<br />
Noon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gnoon</title>
		<link>http://www.kaweb.co.uk/blog/mssql-server-2005-and-codeigniter/comment-page-1/#comment-558</link>
		<dc:creator>gnoon</dc:creator>
		<pubDate>Fri, 16 Jul 2010 03:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.kaweb.co.uk/?p=110#comment-558</guid>
		<description>Thanks a lot for sqlsrv library.

It works perfectly with my SQL 2008 instance except the only error message

ERROR: [2] sqlsrv_rows_affected(): supplied resource is not a valid sqlsrv_stmt resource (line 297)

be written in the CI&#039;s log when I call affected_rows() after an UPDATE execution.

I figured it out by change affected_rows()&#039;s code, according to MSDN(http://msdn.microsoft.com/en-us/library/cc296178(SQL.90).aspx), to

	function affected_rows()
	{
		return @sqlsrv_rows_affected($this-&gt;result_id);
	}

which seems to fix the problem.

Best regards,
Noon</description>
		<content:encoded><![CDATA[<p>Thanks a lot for sqlsrv library.</p>
<p>It works perfectly with my SQL 2008 instance except the only error message</p>
<p>ERROR: [2] sqlsrv_rows_affected(): supplied resource is not a valid sqlsrv_stmt resource (line 297)</p>
<p>be written in the CI&#8217;s log when I call affected_rows() after an UPDATE execution.</p>
<p>I figured it out by change affected_rows()&#8217;s code, according to MSDN(http://msdn.microsoft.com/en-us/library/cc296178(SQL.90).aspx), to</p>
<p>	function affected_rows()<br />
	{<br />
		return @sqlsrv_rows_affected($this-&gt;result_id);<br />
	}</p>
<p>which seems to fix the problem.</p>
<p>Best regards,<br />
Noon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julio Bitencourt</title>
		<link>http://www.kaweb.co.uk/blog/mssql-server-2005-and-codeigniter/comment-page-1/#comment-549</link>
		<dc:creator>Julio Bitencourt</dc:creator>
		<pubDate>Thu, 08 Jul 2010 20:47:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.kaweb.co.uk/?p=110#comment-549</guid>
		<description>Hi!

I got an error when using the version 1.1

Fatal error: Call to undefined function sqlsrv_connect() in ....../system/database/drivers/sqlsrv/sqlsrv_driver.php on line 85

What can I do to fix this?</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>I got an error when using the version 1.1</p>
<p>Fatal error: Call to undefined function sqlsrv_connect() in &#8230;&#8230;/system/database/drivers/sqlsrv/sqlsrv_driver.php on line 85</p>
<p>What can I do to fix this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kervin</title>
		<link>http://www.kaweb.co.uk/blog/mssql-server-2005-and-codeigniter/comment-page-1/#comment-418</link>
		<dc:creator>Kervin</dc:creator>
		<pubDate>Wed, 26 May 2010 13:42:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.kaweb.co.uk/?p=110#comment-418</guid>
		<description>Thanks a lot.

Hopefully this will be included in the main CI build soon.

Great site design, btw.

Best regards,
Kervin</description>
		<content:encoded><![CDATA[<p>Thanks a lot.</p>
<p>Hopefully this will be included in the main CI build soon.</p>
<p>Great site design, btw.</p>
<p>Best regards,<br />
Kervin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl</title>
		<link>http://www.kaweb.co.uk/blog/mssql-server-2005-and-codeigniter/comment-page-1/#comment-324</link>
		<dc:creator>Karl</dc:creator>
		<pubDate>Thu, 15 Apr 2010 08:14:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.kaweb.co.uk/?p=110#comment-324</guid>
		<description>MASSIVE THANKYOU!!!

Spent Hours upon Hours trying to connect to MIcrosoft SQL 2005 Server.</description>
		<content:encoded><![CDATA[<p>MASSIVE THANKYOU!!!</p>
<p>Spent Hours upon Hours trying to connect to MIcrosoft SQL 2005 Server.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://www.kaweb.co.uk/blog/mssql-server-2005-and-codeigniter/comment-page-1/#comment-290</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Tue, 12 Jan 2010 14:47:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.kaweb.co.uk/?p=110#comment-290</guid>
		<description>Hi all.

I&#039;ve actually found a few minutes to update the driver for php_sqlsrv.dll version 1.1, and CodeIgniter 1.7.2 - You can get a newer version of it from the following URL: 

http://www.phrenzy.org/code/sqlsrv-1.1.tar.gz

It contains many of the fixes mentioned in the comments here, plus a few from the CodeIgniter forums.  I hope this helps some of you.</description>
		<content:encoded><![CDATA[<p>Hi all.</p>
<p>I&#8217;ve actually found a few minutes to update the driver for php_sqlsrv.dll version 1.1, and CodeIgniter 1.7.2 &#8211; You can get a newer version of it from the following URL: </p>
<p><a href="http://www.phrenzy.org/code/sqlsrv-1.1.tar.gz" rel="nofollow">http://www.phrenzy.org/code/sqlsrv-1.1.tar.gz</a></p>
<p>It contains many of the fixes mentioned in the comments here, plus a few from the CodeIgniter forums.  I hope this helps some of you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Schwebbie</title>
		<link>http://www.kaweb.co.uk/blog/mssql-server-2005-and-codeigniter/comment-page-1/#comment-284</link>
		<dc:creator>Schwebbie</dc:creator>
		<pubDate>Wed, 06 Jan 2010 14:55:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.kaweb.co.uk/?p=110#comment-284</guid>
		<description>Thanks for this CI driver! I was *finally* able to connect to SQL Server 2005. I&#039;m running an AppServ 2.5.8 install on a Windows XP machine.

I followed the instructions on the Microsoft site to install the new PHP driver. I did have to create an empty db_set_charset function in sqlsrv_driver.php to finally get it to work.

Thanks again for your work!</description>
		<content:encoded><![CDATA[<p>Thanks for this CI driver! I was *finally* able to connect to SQL Server 2005. I&#8217;m running an AppServ 2.5.8 install on a Windows XP machine.</p>
<p>I followed the instructions on the Microsoft site to install the new PHP driver. I did have to create an empty db_set_charset function in sqlsrv_driver.php to finally get it to work.</p>
<p>Thanks again for your work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikko</title>
		<link>http://www.kaweb.co.uk/blog/mssql-server-2005-and-codeigniter/comment-page-1/#comment-220</link>
		<dc:creator>Mikko</dc:creator>
		<pubDate>Mon, 30 Nov 2009 11:40:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.kaweb.co.uk/?p=110#comment-220</guid>
		<description>Thank you for this.

I also got a blank screen and &quot;PHP Fatal error:  Call to undefined method CI_DB_sqlsrv_driver::_db_set_charset(). Adding function db_set_charset to sqlsrv_driver.php solved the issue:

function db_set_charset($charset, $collation) { return TRUE; }

(Using IIS7, SQL Server 2008 and Codeigniter 1.7.2)</description>
		<content:encoded><![CDATA[<p>Thank you for this.</p>
<p>I also got a blank screen and &#8220;PHP Fatal error:  Call to undefined method CI_DB_sqlsrv_driver::_db_set_charset(). Adding function db_set_charset to sqlsrv_driver.php solved the issue:</p>
<p>function db_set_charset($charset, $collation) { return TRUE; }</p>
<p>(Using IIS7, SQL Server 2008 and Codeigniter 1.7.2)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://www.kaweb.co.uk/blog/mssql-server-2005-and-codeigniter/comment-page-1/#comment-51</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Wed, 04 Feb 2009 08:54:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.kaweb.co.uk/?p=110#comment-51</guid>
		<description>If you&#039;re experiencing a blank screen, it&#039;s indicative of a mistake in your configuration (especially since the same happens with the MSSQL driver).

First port of call would be to check your IIS7 error log, and your connection settings in config/database.php.</description>
		<content:encoded><![CDATA[<p>If you&#8217;re experiencing a blank screen, it&#8217;s indicative of a mistake in your configuration (especially since the same happens with the MSSQL driver).</p>
<p>First port of call would be to check your IIS7 error log, and your connection settings in config/database.php.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
