> I occasionally get the following error....
>
> ODBC Error Code = S1000 (General error)
> [Microsoft][ODBC Microsoft Access Driver] Operation must use
> an updateable query.
> SQL = "UPDATE dbcounter SET CounterVal = 91765 where
> CounterName='pagecounter'"
>
> Basically, when I had the problem the other week regarding my
> cold fusion crashing all the time, I placed this code in there
> to keep track of all pages being hit. All this code is doing is
> incrementing a self made counter that I have in my database.
>
> My guess is that too many people are hitting this page at the
> same time and the file is locked and so it throws out an error.
> Is this possible?
I don't use Access enough to know much about it, but usually when I see this
error, the cause is that the database file has been set to be read-only.
However, if the query works some of the time, but not all of the time,
that's pretty unlikely.
> Instead of throwing an error can I have the page continue on
> and ignore any error that may have occurred here?
Yes, using CFTRY and CFCATCH:
<cftry>
<cfquery ...>
UPDATE dbcounter ...
</cfquery>
<cfcatch>
... put any kind of code you want here to deal with the query
failing ...
</cfcatch>
</cftry>
Whether the query runs successfully or not, the code following the CFTRY
block will run unless you explicitly abort the page using CFABORT within the
CFCATCH block.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body or visit the list page at www.houseoffusion.com