Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Error using AddNew, Need Help!!!!!!!


Message #1 by "Chad Gilbertson" <chad_gilbertson@m...> on Thu, 12 Sep 2002 20:29:37
Can anyone suggest if I am doing something wrong in my code?
It is listed below:

Set objRS = Server.CreateObject("ADODB.Recordset")
                       
objRS.Open "Pswd_Auth_Table", objConn, adOpenKeyset, adLockOptimistic, 
                 adCmdTable
                      
objRS.AddNew
objRS("NAID") = Session("VarNaid")
objRS("Inst") = Session("VarInst")
objRS("Pswd") = Session("VarPswd")
objRS("LastUpdatedate") = Date
objRS.Update
objRS.Close
Set objRS = Nothing

It gives me this message:
Error Type: ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of 
the provider, or of the selected locktype.
/pwdb/pswd_generator.asp, line 122


Can anyone tell me why this message is showing up.  I have looked at 
examples in the book, and looked for similiar code/problems in the archives 
and they all look like what I am trying to accomplish.  Anyone have any 
suggestions?

Thanks,
Chad

 
Message #2 by "Ken Schaefer" <ken@a...> on Fri, 13 Sep 2002 11:32:12 +1000
Do you have <%Option Explicit%> at the top of your page (to ensure that your
named ADO constants are actually defined?)

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Chad Gilbertson" <chad_gilbertson@m...>
Subject: [asp_databases] Error using AddNew, Need Help!!!!!!!


: Can anyone suggest if I am doing something wrong in my code?
: It is listed below:
:
: Set objRS = Server.CreateObject("ADODB.Recordset")
:
: objRS.Open "Pswd_Auth_Table", objConn, adOpenKeyset, adLockOptimistic,
:                  adCmdTable
:
: objRS.AddNew
: objRS("NAID") = Session("VarNaid")
: objRS("Inst") = Session("VarInst")
: objRS("Pswd") = Session("VarPswd")
: objRS("LastUpdatedate") = Date
: objRS.Update
: objRS.Close
: Set objRS = Nothing
:
: It gives me this message:
: Error Type: ADODB.Recordset (0x800A0CB3)
: Current Recordset does not support updating. This may be a limitation of
: the provider, or of the selected locktype.
: /pwdb/pswd_generator.asp, line 122
:
:
: Can anyone tell me why this message is showing up.  I have looked at
: examples in the book, and looked for similiar code/problems in the
archives
: and they all look like what I am trying to accomplish.  Anyone have any
: suggestions?
:
: Thanks,
: Chad

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


  Return to Index