|
 |
access_asp thread: ASP with MS Access
Message #1 by sri_core@m... on Mon, 18 Nov 2002 19:23:59
|
|
I got this code snippet from hotscriipts and trying to set up a counter. I
am not able to understand what is the error.
The error is:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable
query.
/counter/counter.asp, line 10
The code is:
<%
Dim Connection, RS, Page, Counts
Page=Request.ServerVariables("SCRIPT_NAME")
Set Connection=Server.Createobject("ADODB.Connection")
Connection.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("counter.mdb")
If Len(Session(Page)) = 0 Then
Set RS = Connection.Execute("SELECT * FROM counter WHERE fldPage
= '" & Page & "'")
If RS.EOF = TRUE Then
Connection.Execute("INSERT INTO counter (fldPage,
fldCount) VALUES ('"&Page&"', 0)")
End If
Set RS = Connection.Execute("SELECT * FROM counter WHERE fldPage
= '" & Page & "'")
Counts=RS("fldCount")+1
Set RS = Connection.Execute("UPDATE counter SET fldCount = " &
Counts & " WHERE fldPage = '" & Page & "'")
Session(Page) = "something"
Connection.Close
Else
Set RS = Connection.Execute("SELECT * FROM counter WHERE fldPage
= '" & Page & "'")
Counts=RS("fldCount")
End If
Response.Write Counts
%>
Any thoughts?
Thanks'
Message #2 by "Sridhar Krishnaswamy" <sriani250@h...> on Mon, 18 Nov 2002 17:17:35 -0500
|
|
Hi, Make sure you have the correct access to update the database. Give
Read/Write/Delete permission. That should solve your problem.
Sridhar
>From: sri_core@m...
>Reply-To: "Access ASP" <access_asp@p...>
>To: "Access ASP" <access_asp@p...>
>Subject: [access_asp] ASP with MS Access
>Date: Mon, 18 Nov 2002 19:23:59
>
>I got this code snippet from hotscriipts and trying to set up a counter. I
>am not able to understand what is the error.
>The error is:
>Microsoft OLE DB Provider for ODBC Drivers error '80004005'
>
>[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable
>query.
>
>/counter/counter.asp, line 10
>The code is:
>
>
><%
>Dim Connection, RS, Page, Counts
>Page=Request.ServerVariables("SCRIPT_NAME")
>Set Connection=Server.Createobject("ADODB.Connection")
>
>Connection.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
>Server.MapPath("counter.mdb")
>If Len(Session(Page)) = 0 Then
> Set RS = Connection.Execute("SELECT * FROM counter WHERE fldPage
>= '" & Page & "'")
> If RS.EOF = TRUE Then
> Connection.Execute("INSERT INTO counter (fldPage,
>fldCount) VALUES ('"&Page&"', 0)")
> End If
> Set RS = Connection.Execute("SELECT * FROM counter WHERE fldPage
>= '" & Page & "'")
> Counts=RS("fldCount")+1
> Set RS = Connection.Execute("UPDATE counter SET fldCount = " &
>Counts & " WHERE fldPage = '" & Page & "'")
> Session(Page) = "something"
> Connection.Close
>Else
> Set RS = Connection.Execute("SELECT * FROM counter WHERE fldPage
>= '" & Page & "'")
> Counts=RS("fldCount")
>End If
>Response.Write Counts
>%>
>Any thoughts?
>Thanks'
_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
|
|
 |