|
 |
application_development thread: AddNew Error
Message #1 by "Chad Gilbertson" <chad_gilbertson@m...> on Thu, 12 Sep 2002 17:12:26
|
|
I am trying to add a record to my table. The code I am using 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. Any suggestions
anyone?
Thanks,
Chad
Message #2 by "Samir Chitkara , Gurgaon" <chitkaras@g...> on Fri, 13 Sep 2002 09:29:15 +0530
|
|
hi!
you havent't mentions the connection string used for connection object.
The problem is that the provider that u r using does not support .update
method.
A solution can be using:
dim str as string
str= "update Pswd_Auth_Table set NAID=" & VarNaid & ",Inst=" & VarInst &
",Pswd=" & VarPswd & "
str=str & " where <<field name>>="
<<key value>>
objconn.execute strsql
-----Original Message-----
From: Chad Gilbertson [mailto:chad_gilbertson@m...]
Sent: Thursday, September 12, 2002 10:42 PM
To: Application Development
Subject: [application_development] AddNew Error
I am trying to add a record to my table. The code I am using 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. Any suggestions
anyone?
Thanks,
Chad
|
|
 |