October 7th, 2008, 11:56 PM
Insert Records in recordset while loop
I am attempting to insert records when in a recordset while loop.
To start, I am querying for records off of one id and from that recordset I want to insert values returned from recordset under a new ID. However, when I execute I get a 500 internal server error.
I have done some brute force debugging and the recordset is returning values.
Here is my code:
Thanks in advance!
SQLQueryProducts="SELECT ProdId, CostOfProd, HourlyRate, OrdWay FROM CustProdLink WHERE CustId='" & request("DuplicateForm") & "'"
rs.open SQLQueryProducts, adoCon
do while not rs.EOF
strSQL = "INSERT INTO ProdCustLink (CustId, ProdId, CostOfProd, hourlyRate, OrdWay) VALUES('" & request("custID") & "', '" & rs("ProdId").Value & "', '" & rs("CostOfProd").Value & "', '" & rs("hourlyRate").Value & "', '" & rs("OrdWay").Value & "')"
October 8th, 2008, 12:29 AM
what is the error? not the generic 500....
if using internet explorer
tools>internet options>advanced>browsing>show friendly http error messages(UNCHECK THIS OPTION)>ok
try your page again...hopefully an error number/description comes up
if so...tell us what line...and message
Comments on this post
Last edited by keep_it_simple; October 8th, 2008 at 12:31 AM.
Reason: removed guess
Please give respect to those that helped solve an issue by clicking on the reputation icon
October 8th, 2008, 12:47 AM
Thanks for the info, completely forgot about turning off friendly HTTP errors.
I fixed it... make sure you use the right table name! Ugh, I can't believe that's the one thing I skipped.