October 7th, 2008, 10: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 7th, 2008, 11:29 PM
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 7th, 2008 at 11:31 PM.
Reason: removed guess
Please give respect to those that helped solve an issue by clicking on the reputation icon
October 7th, 2008, 11:47 PM
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.