[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

How do I create a query from MS Access in Cold Fusion 8?

Hey guys,
 
     I'm trying to create a query in a Cold Fusion webpage. I'm hosting the data in an MS Access DB. Unfortunately, it appears as though creating a local dynamic connection to the database is no longer supported in any version of Cold Fusion over 5.0.

Can anyone tell me how I can "update" this query to conform to a more Cold Fusion 8 standard???

<cfquery name="getQuote"
  dbtype = "dynamic"
  connectstring="DRIVER=Microsoft Access Driver (*.mdb);
  DBQ=Database\C21_Extra.mdb;DriverId=281;
  FIL=MS Access;MaxBufferSize=2048;PageTimeout=5">
  SELECT * FROM tblQuotes
</cfquery>

Note, I do not have access to update the ODBCs or DataSources or anything like that. I can simply update the pages, and drop an Access file in the folder. Is there any hope?

Thanks!!!
0
dfins
Asked:
dfins
  • 3
1 Solution
 
_agx_Commented:
> Is there any hope?

Not unless you have at least one datasource already defined on that server.  
0
 
dfinsAuthor Commented:
I do have datasources defined on that server, but they don't have anything to do with the database that I'm trying to connect to. Does that matter?
0
 
_agx_Commented:
It depends.  The best option (speed, etc..) is obviously to have someone create a datasource for you on that machine. Failing that, you _might_ be able to connect to access VIA another compatible datasource.  What datasource types do you have setup already:  MS Access, MS SQL, etc?
0
 
_agx_Commented:
If you have at least one MS Access datasource defined, you can try using the external db syntax. I don't really use MS Access. So not tested but the syntax is usually _something_ like the query below. But as I mentioned, this is really not the best option. It is slower than a regular query, and may not work with mapped drives.

<cfquery...>
SELECT ... FROM SomeTableName IN 'c:\pathto\yourDatabase.mdb'
</cfquery>

http://blogs.msdn.com/access/archive/2009/03/27/accessing-external-data-using-the-in-clause.aspx
http://office.microsoft.com/en-us/access/HA012314841033.aspx

0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now