Try this out:
<cfset MyConnectionString = "Driver={Microsoft Access Driver
(*.mdb)};Dbq=MyDatabase.mdb;DefaultDir=D:\path2files\;Uid=Admin;
Pwd=Password;">
Changing the "MyDataBase.mdb" to the name of your database file, then
"D:\path2files\" text to the path on the server to your file, and
finally the username and password if your database is password protected
(this one is optional, if not leave as is!). I suggest that you specify
this in your application.cfm is you will need this throughout your
website, otherwise leave it on the same page as the where the <cfquery>
tag will call for it.
The next change needed is to alter the <cfquery> tag a little different
than usual. there is a value that you always pass in <cfquery> that is
titled datasource="".... this will be absent as you are not really
connecting to a datasource, but instead an actual direct database
connection. Below you see a working example of the modified, faster
working <cfquery> tag.
<cfquery name="GetExample" connectstring="#MyConnectionString#"
dbtype="DYNAMIC"> Select * From tablename Order by fieldname </cfquery>
That's it, this is the best example I could possibly give you on how to
use a dynamic <cfquery> connection.
Jason
-----Original Message-----
From: Scott Van Vliet [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 07, 2002 3:43 PM
To: CF-Talk
Subject: DNS-Less Access
Does anyone out there know how to connect to an Access database without
a
DSN? (For both CF 4.5 and CF 5)
TIA!
______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists