Skip to main content
WolfShade
Brainiac
February 7, 2017
Answered

Odd Access db issue - the query that won't update from fresh data

  • February 7, 2017
  • 2 replies
  • 973 views

Hello, all,

I am just fiddling around, a bit, trying to learn something new:  setting up and using an MS Access db in CF10.  Simple, right?

No.. not really.  But I didn't start this thread to give you the details and minutiae regarding getting it to work.  It works.

The issue I'm having is that I wrote a simple query to fetch data from the FIRST table I created (Games) and am retrieving six columns of data.

I'm running a query, using CFDUMP to display it.

I went into the Access database and added three rows of info.  When I refresh the page, the CFDUMP shows only the first three rows.

I deleted those three rows from the Access db, refreshed the page, and still see those three rows of data - nothing else.  Not the new rows I entered.  Nothing changes.

Not sure what to do next.  Please help?

V/r,

^_^

This topic has been closed for replies.
Correct answer EddieLotter

Okay, now I'm REALLY confused.

On the page that runs the SELECT query and CFDUMPs the data, prior to the SELECT query, I added an INSERT query.

Every time I run the page, data is added and the CFDUMP shows it.  HOWEVER - looking at the database in Access, no data is being added.  I still have only the second set of rows that I added, earlier; none of the INSERT query data.

WTF???


I'm beginning to suspect that the Access file that you are using and the Access file that CF is using, are not one and the same.

Try renaming the Access file and see if CF magically continues to work.

Cheers

Eddie

2 replies

WolfShade
WolfShadeAuthor
Brainiac
February 8, 2017

A co-worker suggested that the ODBC DSN that I created in Windows might be the culprit.  It might be caching the query.  However, I have opened odbcad32.exe (where I created the DSN) and cannot find any setting for caching.  Windows 7. 

Could that be it?  Windows is caching the query, not CF or the browser?

V/r,

^_^

BKBK
Adobe Expert
February 8, 2017

Cache perhaps. To rule out page cache, force a refresh by adding an arbitrary argument to the URL, for example, http://...testpage.cfm?myVar=x

To rule out database connection cache, go to the Access datasource settings in the ColdFusion Administrator. Click on 'Show Advanced Settings', uncheck the checkbox 'Maintain Connections' and submit the changes.

WolfShade
WolfShadeAuthor
Brainiac
February 8, 2017

Hi, BKBK​,

I was kind of tired when I wrote my post, and didn't include everything.  Sorry.  I'm perpetually tired.

When I first noticed it, I tried your suggestion of using an arbitrary URL parameter; no change.  Even used Ctrl-F5; no change.

Logged on to CFAdmin, and made sure that nothing is being cached - all 'cache-related' checkboxes unchecked.  No change.  Cleared cache, just in case; no change.

Altered the query, slightly, to force a fresh query (added " , 'hey' as joe " to the select - it appeared in the refresh.. next to the three records that had been deleted, instead of the three new records that were in the database; otherwise, still getting the deleted records.)

Added attribute " cachedwithin='#CreateTimeSpan(0,0,0,0)#'" to the CFQUERY tag; no change.

And then I took it one step further.  I use FireFox for my development.  This page had never been opened in IE.  I opened it in IE; no change.

This is clearly not a cache issue - neither the server-side, nor the client-side.

This has me totally baffled.

V/r,

^_^

PS:  In CF10, CFAdmin Datasources, when creating an Access DSN, "Maintain Connections" is defaulted OFF.  I never checked it on.

WolfShade
WolfShadeAuthor
Brainiac
February 8, 2017

Perhaps something went wrong during the manual insert. Wat happens when you insert the 3 rows by means of an INSERT query?


Okay, now I'm REALLY confused.

On the page that runs the SELECT query and CFDUMPs the data, prior to the SELECT query, I added an INSERT query.

Every time I run the page, data is added and the CFDUMP shows it.  HOWEVER - looking at the database in Access, no data is being added.  I still have only the second set of rows that I added, earlier; none of the INSERT query data.

WTF???