Friday 31 August 2012

Delete Offline Files in Windows 7


As a user of the 'Always available offline' feature in Windows 7, I find the interface for it is very counterintuitive. One of the missing features which I find most irritating is that you cannot simply remove the files (and hence free up some space) which you no longer want to be available offline. If you are finding the same problem, then follow these steps I used to successfully delete the files. Note that you must have administrative rights to perform these tasks, and the method below will delete all the offline files, so make sure everything is backed up.

  1. Firstly, disable offline files by typing in 'manage offline files' into your start menu and hitting disable. You must restart for this to take effect.
  2. You can now edit your registry (with care) to tell Windows to purge the files.
  3. Open regedit.exe. Navigate to HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > services > CSC > Parameters. Create a new parameter of type DWORD and call it 'FormatDatabase' and set its value to 1.
  4. Reboot. After rebooting, you can re-enable offline files and all of your existing offline files should be removed.

Tuesday 28 August 2012

Merge PDFs with ColdFusion

ColdFusion cfpdf merge function

Use ColdFusion to merge 2 (or more) PDF files together. 'Order' is a parameter which can be used to specify the order in which to merge the documents.

This example merges 2 PDF documents and assumes the directories exist from the server root '/upload/' and '/upload/merged/'




Click here for a Demo or find this tutorial on learncf.com

Tuesday 21 August 2012

Error Executing Database Query

[Macromedia][SQLServer JDBC Driver]Value can not be converted to requested type.

I received this vague error after I had added some extra columns into a table.

The code:



It turns out the error was being caused by the SELECT * as the ColdFusion server must have been caching the query. Restarting ColdFusion server fixed this, but to avoid receiving this error in the future only the columns that are required in the query should be listed.

Monday 13 August 2012

ColdFusion 10 and MS SQL Server 2012 Express

How to set up ColdFusion 10 with MS SQL Server 2012 Express

These are the steps I followed to set it up. I found I had to use SQL server's "sa" account in order to get it working properly, but I would not recommend doing this on anything which requires security.

  1. Install MS SQL Server, choose the option to install a 'New SQL stand-alone installation...'
  2. Choose the option to customise each feature and select the features as shown below.

  1. In the Database Engine Configuration page, choose Mixed Mode and create a password as well as adding the current Windows user account (to easily allow access with SQL Server Management Studio).

  1. Complete the installation and then open the SQL Server Configuration Manager.
  2. On the side panel, expand SQL Server Network Configuration, and select Protocols for SQLEXPRESS. Enable TCP/IP and click properties.
  3. In the properties tab, set the port number for each field in the IP Addresses tab, I used port 3306.
  4. Again on the side panel, select SQL Server Services and restart SQL Server (SQLEXPRESS).
  5. Open MS SQL Server Management Studio and login using Windows authentication.
  6. Expand security > logins, right click properties on "sa". Set the password.
  7. Open ColdFusion Administrator and select the Data Sources tab.
  8. Enter the name you wish to use to refer to the data source, and select MS SQL Server for the driver.
  9. Enter the database name, server IP address and port set in step 6, and username "sa" with the password set in step 9 and submit. If all is well, ColdFusion should display a confirmation message in green text.

I hope you found this helpful. Please leave me a comment.