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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with addNew

Status
Not open for further replies.
Jan 26, 2001
550
GB
Hi guys, could anyone shed any light on this problem, i am relatively inexperienced with ASP and VBScript? All this page is supposed to do is display the entries from an Access Database (which it does just fine), and then add an entry to that same database. Trouble is the addNew function doesnt seem to work, and i get this error:

ADODB.Recordset error '800a0cb3'

The operation requested by the application is not supported by the provider.

/AERO2/displayusers.asp, line 34


Heres the code:


<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>

<% language=VBScript %>
<%

Dim Connect, userRS, Query

Set Connect = Server.CreateObject(&quot;ADODB.Connection&quot;)
Connect.Open &quot;users&quot;
Set userRS = Server.CreateObject(&quot;ADODB.Recordset&quot;)
userRS.CursorType = adOpenDynamic
Query = &quot;SELECT * FROM users&quot;
userRS.Open Query, Connect

do until userRS.EOF
%>
<%=userRS(&quot;name&quot;)%><BR>
<%=userRS(&quot;housenumber&quot;)%><BR>
<%=userRS(&quot;street&quot;)%><BR>
<%=userRS(&quot;town&quot;)%><BR>
<%=userRS(&quot;county&quot;)%><BR>
<% userRS.MoveNext

loop %>

<%

userRS.AddNew

userRS(&quot;name&quot;)=&quot;Barbara&quot;
userRS(&quot;street&quot;)=&quot;pittville&quot;
userRS(&quot;county&quot;)=&quot;worcs&quot;
userRS.Update%>

</body>
</html>


Its probably something really simple but i can't work it out! Can anyone help?

Many Thanks,

Nick :)
Nick (Web Designer)
nick.price@misuk.net
 
After

userRS.CursorType = adOpenDynamic

add

userRS.LockType = adLockPessimistic

should work... _________________
Bixarrio
e = m * (c ^ 2)
 
Hi Bixarrio,

Thanks for your suggestion but i tried it and i got this error message for that line:

The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another.

Any suggestions?

Thanks,

Nick (Web Designer)


nick@retrographics.co.uk
 
OK, I finally managed to work this out, and it wasnt anything to do with the existing code! Heres the answer for anyone who has this annoying problem in the future:

You need to use this line of code:

<!--#include file=&quot;adovbs.inc&quot; -->

The file adovbs.inc can be found in the Windows/Program Files/Common Files/System/ADO and should be copied into the same folder as the page in question. This solved the problem for me :)

Nick (Web Designer)


nick@retrographics.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top