Dec 8, 2002 #1 Krogh Programmer Aug 16, 2001 22 CH I'd like know if there is a way in ColdFusion to use a MS Access database without an ODBC link. thx for help
I'd like know if there is a way in ColdFusion to use a MS Access database without an ODBC link. thx for help
Dec 9, 2002 #2 twcman Programmer Jun 28, 2001 284 US Hello, Put the following code in your application.cfm file <!--- enter your dbase name here ---> <cfset REQUEST.dbase = "databasename.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=;"> Use this code when you need to access the database: <cfquery name="yourqueryname" dbtype="dynamic" connectstring="#REQUEST.connectstring#"> Select fieldname from tablename </cfquery> This can be slower than an ODBC link but depends on the size of the queried data. The only dumb questions are the ones that are never asked Upvote 0 Downvote
Hello, Put the following code in your application.cfm file <!--- enter your dbase name here ---> <cfset REQUEST.dbase = "databasename.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=;"> Use this code when you need to access the database: <cfquery name="yourqueryname" dbtype="dynamic" connectstring="#REQUEST.connectstring#"> Select fieldname from tablename </cfquery> This can be slower than an ODBC link but depends on the size of the queried data. The only dumb questions are the ones that are never asked
Dec 9, 2002 #3 SidianConsulting Programmer Jun 24, 2002 438 US Just a note, this only works in ColdFusion 5.0; it didn't exist before that version and CFMX doesn't support it. -Tek Upvote 0 Downvote
Just a note, this only works in ColdFusion 5.0; it didn't exist before that version and CFMX doesn't support it. -Tek
Dec 9, 2002 #4 twcman Programmer Jun 28, 2001 284 US Teknology, You're correct. Sorry I missed adding that note...:> The only dumb questions are the ones that are never asked Upvote 0 Downvote
Teknology, You're correct. Sorry I missed adding that note...:> The only dumb questions are the ones that are never asked
Dec 10, 2002 Thread starter #5 Krogh Programmer Aug 16, 2001 22 CH i saw another way on an older post... what's about that way ? does it work in MX ? <cfset dsn = "c:\my_dbase.mdb"> <cfquery datasource="#dsn#" dbtype="OLEDB" provider="Microsoft.Jet.OLEDB.4.0" providerdsn="#dsn#" username="Admin" password="" name="qry_get_user_data"> ... </cfquery> Upvote 0 Downvote
i saw another way on an older post... what's about that way ? does it work in MX ? <cfset dsn = "c:\my_dbase.mdb"> <cfquery datasource="#dsn#" dbtype="OLEDB" provider="Microsoft.Jet.OLEDB.4.0" providerdsn="#dsn#" username="Admin" password="" name="qry_get_user_data"> ... </cfquery>