I grabbed this from a web site recently....

<CFQUERY NAME="rs"
  DBTYPE="dynamic"
  CONNECTSTRING="Driver={Microsoft Access Driver 
(*.mdb)};Dbq=#ExpandPath('..\bettergig\cgi-bin\bettergig.mdb')#;Uid=Admin;Pwd=pass;"
 >
SELECT SeekId, SeekUsername, SeekPassword from Seekers
</CFQUERY>

The connection string could be built up in a variable to make it easier 
to read as well:

<CFSET rsUser="Uid=#form.username#;">
<CFSET rsPass="Pwd=#form.password#;">
<CFSET theDatabase="#ExpandPath('..\bettergig\cgi-bin\bettergig.mdb')#;">
<CFSET theString="Driver={Microsoft Access Driver (*.mdb)};Dbq=">
<CFSET theString=theString & theDatabase & rsUser & rsPass>

<CFQUERY NAME="rs"
  DBTYPE="dynamic"
  CONNECTSTRING="#theString#"
 >
SELECT SeekId, SeekUsername, SeekPassword from Seekers
</CFQUERY>


Anthony DeStefano wrote:
> Does anyone know the syntax to connect to an Access DB without a DSN?
> 
> Also, are there any pros/cons to using DSN-Less connections. I have done it
> in ASP without any noticable performance issues, but I am not sure about how
> ColdFusion deals with it.
> 
> Many Thanks,
> Tony
> 
> Anthony DeStefano
> Programmer/Analyst
> Telect, Inc.
> (509) 893-4375
> [EMAIL PROTECTED]
> 
> 
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
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

Reply via email to