472,127 Members | 2,051 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

access_asp Error Type:ADODB.Recordset (0x800A0CB3)

Hi,
I m getting this message after executing the following code
Expand|Select|Wrap|Line Numbers
  1. <%
  2. CALL OPENDATACON
  3. DIM RS
  4. SET RS=SERVER.CreateObject ("ADODB.RECORDSET")
  5. s="select * from dbpassenger order by ref_no"
  6. CALL OPENRS(RS,S)
  7. DIM RS1
  8. dim aa
  9. SET RS1=SERVER.CreateObject ("ADODB.RECORDSET")
  10. s="select * from dbfare where flight_id='" & session("fid") & "'"
  11. CALL OPENRS(RS1,S)
  12. if rs.RecordCount >0 then
  13. rs.MoveLast
  14. aa=rs("ref_no") + 1
  15. else
  16. aa=1
  17. end if
  18. session("ref_no")=aa
  19. DIM XX
  20. xx=0
  21. <%    if  len(trim(request("txtfname1")))>0 then
  22.         RS.AddNew ' I m getting error on this line
  23.         rs("ref_no")=CINT(aa)
  24.         rs("flight_id")=session("fid")
  25.         rs("first_name")=request("txtfname1")
  26.         rs("last_name")=request("txtlname1")
  27.         rs("sex")=request("sex1")
  28.         rs("age")=request("TXTage1")
  29.         if request("TXTage1")<12 then
  30.             xx=xx+rs1("fare_child")
  31.         else
  32.             xx=xx+ rs1("fare_adult")
  33.         end if
  34.  
Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype

I m using SQL Server 2000 with asp.
here ref_no is numeric
May 6 '07 #1
3 5560
jhardman
3,406 Expert 2GB
it looks like you are opening the db without the correct lock type. Try this:
Expand|Select|Wrap|Line Numbers
  1. DIM RS,RS1, objConn
  2. set objConn = server.createObject("ADODB.Connection")
  3. SET RS=SERVER.CreateObject ("ADODB.RECORDSET")
  4. s="select * from dbpassenger order by ref_no"
  5. RS.open s, objConn, adOpenDynamic, adLockOptimistic
  6.  
Let me know if this helps.

Jared
May 7 '07 #2
CALL OPENDATACON
DIM RS,RS1, objConn
set objConn = server.createObject("ADODB.Connection")
SET RS=SERVER.CreateObject ("ADODB.RECORDSET")
s="select * from dbpassenger order by ref_no"
RS.open s, objConn, adOpenDynamic, adLockOptimistic'Now showing
'error on this line
'DIM RS
'SET RS=SERVER.CreateObject ("ADODB.RECORDSET")
's="select * from dbpassenger order by ref_no"
'CALL OPENRS(RS,S)
'DIM RS1
dim aa
SET RS1=SERVER.CreateObject ("ADODB.RECORDSET")
s="select * from dbfare where flight_id='" & session("fid") & "'"
CALL OPENRS(RS1,S)
if rs.RecordCount >0 then
rs.MoveLast
aa=rs("ref_no") + 1
else
aa=1
end if
session("ref_no")=aa
DIM XX
xx=0

Error Type:
ADODB.Recordset (0x800A0E7D)
The connection cannot be used to perform this operation. It is either closed or invalid in this context.
May 8 '07 #3
<%@ Language=VBScript %>
<!-- #INCLUDE FILE="FLIGHT.inc" -->
<!--#include file="ADOVBS.inc"-->
<%=header%>
<br><br>
<%
CALL OPENDATACON
DIM RS
SET RS=SERVER.CreateObject ("ADODB.RECORDSET")
s="select * from dbpassenger order by ref_no"
CALL OPENRS(RS,S)
DIM RS1
dim aa
SET RS1=SERVER.CreateObject ("ADODB.RECORDSET")
s="select * from dbfare where flight_id='" & request.querystring("id") & "'"
CALL OPENRS(RS1,S)
if RS.RecordCount >0 then
RS.MoveLast
aa=RS("ref_no") + 1
else
aa=1
end if
session("ref_no")=aa
DIM XX
xx=0
<% if len(trim(request("txtfname1")))>0 then
rs.AddNew 'Error for this line
rs("ref_no")=CINT(aa)
rs("flight_id")=session("fid")
rs("first_name")=request("txtfname1")
rs("last_name")=request("txtlname1")
rs("sex")=request("sex1")
rs("age")=request("TXTage1")
if request("TXTage1")<12 then
xx=xx+rs1("fare_child")
else
xx=xx+rs1("fare_adult")
end if

I even made changes to .inc file as suggested but achieved no success..
Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.
May 8 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.