ColdFusion does not connect to the default install of SQL Server Express 2005. After much swearing I discovered that you need to enable TCP/IP (which is disabled by default).
To enable it go to Start -> Programs -> Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server Configuration Manager. In the SQL Server 2005 Network Configuration, click on Protocols for SQLEXPRESS. Click on TCP/IP, and tick the box to enable it. Note: You will need to restart the SQL Server Service, which you can do from Services in your Control Panel.
If you have a firewall, then you need to allow SQL Server. It is a good idea to lock TCP/IP connections down to one port for security. SQL Server 2000 used port 1433. To set the port, clear the value for “TCP Dynamic Ports” and enter the port you want to use in the “TcpPort” box. Note: you will need to use the same port in the ColdFusion CFIDE administrator.
One question a client asks is “Why do you use ColdFusion?”. So, here are my thoughts…
- ColdFusion is a proven enterprise level web application server.
- ColdFusion is owned by Adobe who are responsible for Photoshop and PDF Writer
- ColdFusion is the only platform with native (in-built) support for PDF manipulation and creation – remember Adobe also produce the industry PDF Writer and pioneer the PDF format and PDF reader.
- ColdFusion now has worldclass image manipulation – remember Adobe also produce the industry standard Photoshop.
- ColdFusion is a professional commercial product, so you get professional support from Adobe.
- ColdFusion is great for Rapid Application Development.
- ColdFusion is available as Open Source from BlueDragon.
- ColdFusion can run on multiple platforms and multiple web servers.
- If ColdFusion wasn’t any good then it would have died out years ago, when you consider that PHP, Ruby and ASP.Net are free (although you will have to pay for a Windows server to run full blown ASP.NET).
- ColdFusion has a built-in search engine.
- ColdFusion has built-in scheduled tasks (every tried to do that with PHP!?)
- ColdFusion has excellent database connectivity using JDBC.
- ColdFusion has built-in functionality for consuming and publishing webservices, it will now handle MS generated SOAP webservices.
I recently had a problem where I wanted to delete records from a ColdFusion recordset. I often use build query objects on the fly to store data. Unfortunately you can’t use delete or update statements in Query of Queries, in the end I used a select statement with a where clause to filter out the unwanted records which works a treat!
Example:
<!--- populate a query object --->
<cfset qryExample = QueryNew('id') />
<cfloop from="1" to="10" index="ndx">
<cfset QueryAddRow(qryExample) />
<cfset QuerySetCell(qryExample, "id", ndx) />
</cfloop>
<cfdump var="#qryExample#" /><!--- remove a record from our recordset using Query of Queries --->
<cfquery name="qryExample" dbtype="query">
select * from qryExample
where id <> 1
</cfquery>
<cfdump var="#qryExample#" />
I always forget how to do break out of the each() method when iterating through a jQuery object.
<script type="text/javascript">
/* <![CDATA[ */
$('#rates-frm').submit(function(){
var bValid = true;
$('#rates-frm input[@type="text"]').each(function(i, o){
alert('index: ' + i + ' object id: ' + o.id);
if (i > 5) {
return false;
}
});
});
/* ]]> */
</script>
“ = “
” = ”
‘ = ‘
’ = ’