Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE DB Error/ Query Error

Status
Not open for further replies.

Newbie311

Programmer
Oct 6, 2003
30
0
0
GB
Hi there, I am trying to run an asp page and i keep getting the following error;

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
line 23

could someone translate this to me in plain english?I dont understand what it means by updateable query?

Thanks!
 
Post your code and identify the specific line where the error has occured and I (or anyone else here I am sure) will be glad to try and help you.

-a6m1n0

"Don't try to reinvent the wheel." -My HS FORTRAN Professor
 
Here is the code, I have shown what the error is referring to below


<%'prevent cacheing
Response.CacheControl = "no-store"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
%>
<!-- #include file="inc/declareinc.asp"-->
<%
quantity=0
saved_quantity=0
Subtotal=0


'establish the basket id in a session and a cookie.
'if it doesn't exist then enter a new basket into the database.
if session("basket_id")="" then
if request.cookies("basket_id")="" then
sql="select max(basket_id) from basket"
set objrs=objconn.execute(sql)
if not objrs.eof then
max_basket_id=cint(objrs(0))+1
basket_id=max_basket_id
sql="insert into basket (user_id) values ("&basket_id&")"
******************************************************
ERROR ON THIS LINE! objconn.execute(sql)
response.Cookies("basket_id")
******************************************************


=max_basket_id
response.Cookies("user_id").expires=#1/1/2010 00:00:00#
session("basket_id")=max_basket_id
else
Response.write "error"
Response.end
end if
else
session("basket_id")=request.cookies("basket_id")
basket_id=request.cookies("basket_id")
end if
else
basket_id=session("basket_id")
end if

catid=request.querystring("catid")
if catid<>"" then
' it's an action from this page.

if request.querystring("act")="add" then
call add(catid, basket_id)
end if

if request.querystring("act")="addtocart" then
call addtocart(catid, basket_id)
end if


if request.querystring("act")="save" then
call addtosave(catid, basket_id)
end if


if request.querystring("act")="delete" then
call delete_product(catid, basket_id)
end if
end if
%>
 
before closing your recordset try this


sql="insert into basket (user_id) values ("&basket_id&")"
'objconn.execute(sql)
response.write(sql)

tell us what it says
 
Ive done what you've just said and now the same error occurs on another line. The next line it refers to is 183 and contains the same objconn.execute(sql) which it doesn't seem to like?

Maybe it doesnt like that string?


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top