Active Server Pages

Moderators: None (Apply to moderate this forum)
Number of threads: 1751
Number of posts: 4473

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
current recordset does not support updating Posted by bas_si on 11 Dec 2004 at 7:40 AM
ADODB.Recordset (0x800A0CB3)
i cannot store anything to my database, what am i doing wrong, please help
my code:

<%@ LANGUAGE="VBSCRIPT" %>
<html>
<head><title>Confirmation </title></head>
<body bgcolor ="black">
<%
set db = Server.CreateObject("ADODB.Connection")
db.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("members.mdb") & " ; "
set rs=db.execute("SELECT * FROM tblmembers")
rs.AddNew
rs.Fields("Name")= "sebastians"
rs.UpdateBatch
rs.MoveFirst
Response.Write rs("Name")


%>


</body>
</html>

Report
Re: current recordset does not support updating Posted by Flakes on 12 Dec 2004 at 10:22 PM
: ADODB.Recordset (0x800A0CB3)
: i cannot store anything to my database, what am i doing wrong, please help
: my code:
:
: <%@ LANGUAGE="VBSCRIPT" %>
: <html>
: <head><title>Confirmation </title></head>
: <body bgcolor ="black">
: <%
: set db = Server.CreateObject("ADODB.Connection")
: db.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("members.mdb") & " ; "

set rs= Server.CreateObject("ADODB.RecordSet")
rs.Open "SELECT * FROM tblmembers",db,3,2
'3-adOpenStatic
'2-adLockPessimistic
'Look into adovbs.inc in you root for the whole list

: rs.AddNew
: rs.Fields("Name")= "sebastians"
: rs.UpdateBatch
: rs.MoveFirst
: Response.Write rs("Name")
:
:
: %>
:
:
: </body>
: </html>
:
:


When you open a recordset using connection.Execute,the default properties are set for the recordset,which are not enough for an update.





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.