current recordset does not support updating

ADODB.Recordset (0x800A0CB3)
i cannot store anything to my database, what am i doing wrong, please help
my code:

<%@ LANGUAGE="VBSCRIPT" %>

Confirmation

<%
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")


%>





Comments

  • : ADODB.Recordset (0x800A0CB3)
    : i cannot store anything to my database, what am i doing wrong, please help
    : my code:
    :
    : <%@ LANGUAGE="VBSCRIPT" %>
    :
    : Confirmation
    :
    : <%
    : set db = Server.CreateObject("ADODB.Connection")
    : db.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("members.mdb") & " ; "
    [red]
    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
    [/red]
    : rs.AddNew
    : rs.Fields("Name")= "sebastians"
    : rs.UpdateBatch
    : rs.MoveFirst
    : Response.Write rs("Name")
    :
    :
    : %>
    :
    :
    :
    :
    :
    :


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


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion