Creat a ColdFusion collection with the cfcollection tag
On occasion a developer may not have access to ColdFusion Administrator, for example, if you use a virtual hosting company. If you want your ColdFusion application to be able to create, delete, and maintain a collection you will need to use the cfcollection tag. The following will show you how to create a collection index it then index it to include a MS Access database this code works great for use with a serch function for your shopping cart site. You will need to create an Access database with a table named Products and you will need the following fields ItemID, ProductID, ProductName, BriefDescription, Details.

To create a simple collection form page:
Create a ColdFusion page with the following content:
<html>
<head>
<title>Collection Creation Input Form</title>
</head>
<body>
<h2>Specify a collection</h2>
<form action="collection_action.cfm" method="POST">
<!--- The following can be changed to your needs --->

<cfcase value="Delete">
<cfcollection action="Delete"
collection="mycart">
<p>Collection mycart deleted.
</cfcase>
</cfswitch>
</cfoutput>
</body>
</html>
Save the file as collection_action.cfm in the web root directory.
In the web browser, enter the following URL to display the form page:http://www.yourserve...ection_form.cfm
Verify that Create is selected and submit the form.
You successfully created a collection, named mycart. Now we have to index it.

Indexing a collection using the cfindex tag
You can index a collection using the cfindex tag, which eliminates the need to use the ColdFusion MX Administrator.
Create a ColdFusion page with the following content:
<html>
<head>
<title>Creating Index</title>
</head>
<body>
<h2>Indexing Complete</h2>

<cfoutput>
The collection mycart has been indexed.
</cfoutput>
</body>
</html>
Save the file as collection_index_action.cfm in web_root.
In the web browser, enter the following URL to display the form page:http://www.yourserver.com/ collection_index_action.cfm
A confirmation message appears upon successful completion.

Adding database information to a CF collection
To add your database information to your collection:
Create a ColdFusion page with the following content:
<html>
<head>
<title>Adding Query Data to an Index</title>
</head>
<body>