Home · Standard Web Hosting · Dedicated Web Hosting · Managed Name Servers · E-Mail Services
 
Home
/ Browse Categories / SmartWeb / Windows Services / Connecting to an Access DB using a connection string (not ODBC)
Connecting to an Access DB using a connection string (not ODBC)

//**************************************
// Name: Dynamic CFquery's with Access
// Description:Connect to your Access da
// tabase using a connection string instead
// of ODBC
// By: Steve Oliver
//
// Inputs:connection string
//
// Side Effects:Only works on CF5.0
//
//This code is copyrighted and has
// limited warranties.Please see http://
// www.Planet-Source-Code.com/xq/ASP/txtCod
// eId.38/lngWId.9/qx/vb/scripts/ShowCode.htm for details
//
//**************************************

This will go in your Application.cfm.

<!--- enter your dbase name here --->
<cfset REQUEST.dbase = "leads.mdb">
. <!---gets directory that application.cfm is in --->
<cfset REQUEST.directory = "#getDirectoryFromPath(getCurrentTemplatePath())#">
.
<!---sets the connection string --->
<cfset REQUEST.connectstring = "Driver={Microsoft Access Driver (*.mdb)}";
Dbq=#REQUEST.dbase#;
DefaultDir=#REQUEST.directory#;
Uid=;
Pwd=;>
.
.
.
And this will go wherever you want to make a query.
.
<cfquery name="qryName" dbtype="dynamic" connectstring="#REQUEST.connectstring#">
SELECT * FROM tbl
</cfquery>



User Comments
Connecting to an Access DB using a connection string (not ODBC)
Add Comment
There are no user comments for this topic.
Add Comment
Additional Info
General Information
Article No. 79
Created: 01:53 AM 04.16.04
Author: Support

Attachments
No attachments.

Did this help you?
Yes No

Statistics
Yes529 (45%) Voted Yes652 (55%) Voted NoNo

Other Options
Print Article
Email Article

Related Articles
What COM Objects / Components do you support?
Create a DSN for an MS Access Database
Create a DSN for a MS SQL server
Create a DSN for a MySQL Database
Connecting to a database with a DSN

Copyright © 2013 myonlinehostingsupport.com