Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > ASP Add Record Approaches

Reply
Thread Tools

ASP Add Record Approaches

 
 
Matthew Louden
Guest
Posts: n/a
 
      09-27-2003
The following ASP code yields the following run-time error, I want to know
which approaches for adding records. Using "Insert Into" statement or AddNew
method in recordset object?? As I mentioned in previous post, when I use
"Insert Into" SQL statement, it yields "ADODB.Recordset error '800a0e78'
Operation is not allowed when the object is closed."

<%
Dim objRS
Set objRS = Server.CreateObject ("ADODB.Recordset")
objRS.Open "test", strConnect, adOpenStatic, adLockOptimistic, adCmdTable
objRS.MoveLast
objRS.AddNew ' add a new record
objRS("id") = "9999"
objRS("name") = "Psycho"
objRS.Update
objRS.Close
Set objRS = Nothing
%>

ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.




 
Reply With Quote
 
 
 
 
Ken Schaefer
Guest
Posts: n/a
 
      09-27-2003
www.adopenstatic.com/faq/800a0bb9.asp

That said, please see answer to your previous post - you should use the SQL
statement, but not the recordset object.

Cheers
Ken

"Matthew Louden" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
: The following ASP code yields the following run-time error, I want to know
: which approaches for adding records. Using "Insert Into" statement or
AddNew
: method in recordset object?? As I mentioned in previous post, when I use
: "Insert Into" SQL statement, it yields "ADODB.Recordset error '800a0e78'
: Operation is not allowed when the object is closed."
:
: <%
: Dim objRS
: Set objRS = Server.CreateObject ("ADODB.Recordset")
: objRS.Open "test", strConnect, adOpenStatic, adLockOptimistic,
adCmdTable
: objRS.MoveLast
: objRS.AddNew ' add a new record
: objRS("id") = "9999"
: objRS("name") = "Psycho"
: objRS.Update
: objRS.Close
: Set objRS = Nothing
: %>
:
: ADODB.Recordset error '800a0bb9'
: Arguments are of the wrong type, are out of acceptable range, or are in
: conflict with one another.
:
:
:
:


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
You cannot add or change a record because a related record is required in table 'lok" André ASP .Net 0 06-25-2006 01:30 PM
You cannot add or change a record because a related record is required in table 'lok" André ASP .Net Web Controls 0 06-25-2006 01:30 PM
How to add a button to Modify, delete or add a new record to this code karenmiddleol@yahoo.com ASP General 2 10-04-2005 11:55 AM
How to add a button to Modify, delete or add a new record to this code karenmiddleol@yahoo.com ASP General 0 10-01-2005 07:21 AM
State Machine Approaches - A Revisit Calvin VHDL 2 07-13-2005 08:01 PM



Advertisments