?
Solved

ASP Recordset Array Error

Posted on 2003-02-19
3
Medium Priority
?
773 Views
Last Modified: 2007-12-19
Provider error '80040e1b'
Identity cannot be determined for newly inserted rows.

Does anyone know what might be causing the above error. The loop is updating a database and on the first loop is doing so successfully but on the second loop the above error is being returned

Here is my code:

For I=0 to Ubound(MyArray)
        if MyArray(I)<>0 then
                rsAddComments3.Fields("Product_id") =(Recordset1.Fields.Item("Product_id").Value)
                rsAddComments3.Fields("Order_id") = CInt(num)
                rsAddComments3.Fields("Order_qty") = CInt(MyArray(I))
                rsAddComments3.Update
                'I=I+1
        end if
         Recordset1.MoveNext()
Next

0
Comment
Question by:Philby_Walsh
3 Comments
 

Expert Comment

by:Kavius
ID: 7982547
Do you ever move your rsAddComments3 recordset? Are you adding to your rsAddComments3? If so you need to issue a .AddNew method.  I guess I'm just getting confused, what does each of your recordsets and your array contain and what are you trying to do?

This looks similar to the problem you are having, not exact but...

http://p2p.wrox.com/archive/sql_server_asp/2001-09/27.asp



0
 
LVL 2

Accepted Solution

by:
mikelovell earned 40 total points
ID: 7983782
that's correct, this would mean you're trying to set a value when you aren't at a specific location in the database, however (as kavius mentions) if you use an 'addnew' before you set the values, it should work fine.
0
 
LVL 4

Expert Comment

by:Wakie
ID: 7984422
Please paste here all of your ASP code including your relevant SQL queries.

Also, please maintain the following open question:

http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20495929.html

Regards,
Wakie.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.
Hi, this video explains a free download that you can incorporate into your Access databases, or use stand-alone for contact management. Contacts -- Names, Addresses, Phone Numbers, eMail Addresses, Websites, Lists, Projects, Notes, Attachments…

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question