Why does this code bomb

Results 1 to 2 of 2

Thread: Why does this code bomb

  1. #1
    Join Date
    Dec 1969

    Default Why does this code bomb

    I&#039;ve written a program that stores various information into cookies that are later taken and stored in a DB (SQL Server).<BR><BR>One Cookie stores Customer information, another stores transaction information. When I go to put the transaction information, the code only works if I have a single record to put in. If I have to store multiple records, I get this error...<BR><BR>Microsoft Cursor Engine (0x80040E21)<BR>Multiple-step operation generated errors. Check each status value.<BR><BR>I&#039;ve checked each field in the database, and I know for sure that there is enough space to hold each item. I have also trimmed the cookies before they get put in. Does anyone have any idea what is wrong with this.<BR><BR>As an added note, the cookies that hold the transaction information are created dynamically. When you look at the code, intReverseCount is a counter that differentiates between the cookies. The code for the section that gives me trouble is below...<BR><BR><BR><BR>set objRS2 = Server.CreateObject("ADODB.Recordset")<BR>objRS2.O pen "tblTrafficTransactionDetail",objConn,,adLockOptim istic,adCmdTable<BR><BR>intReverseCount = Session("intServiceCount")<BR>For i = Session("intServiceCount") to 1 step -1<BR>If Request.Cookies("TrafficReport" & intReverseCount)("ReportType") &#060;&#062; "" then <BR>objRS2.AddNew<BR>objRS2("tblTrafficTransaction $TransNum") = intTransNum<BR>objRS2("tblTrafficService$ServiceNa me") = rtrim(Request.Cookies("TrafficReport" & intReverseCount)("ReportType"))<BR>objRS2("tblTraf ficService$ServicePrice") = rtrim(Request.Cookies("TrafficReport" & intReverseCount)("Price"))<BR>objRS2("ClaimNum") = rtrim( Request.Cookies("TrafficReport" & intReverseCount)("ClaimNumber"))<BR>objRS2("HQNum" ) = rtrim(Request.Cookies("TrafficReport" & intReverseCount)("HQNumber"))<BR>objRS2("Complaint Num") = rtrim(Request.Cookies("TrafficReport" & intReverseCount)("ComplaintNumber"))<BR>objRS2("Dr iverFName") = rtrim(Request.Cookies("TrafficReport" & intReverseCount)("DriverFName"))<BR>objRS2("Driver LName") = rtrim(Request.Cookies("TrafficReport" & intReverseCount)("DriverLName"))<BR>objRS2("Accide ntDate") = rtrim(Request.Cookies("TrafficReport" & intReverseCount)("AccidentDate"))<BR>objRS2.Update <BR>End if<BR>intReverseCount = intReverseCount - 1<BR>Next<BR><BR>objRS2.Close <BR>set objRS2 = nothing<BR><BR>Thank you,<BR><BR>BCH<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Check the data on each pass...

    Put in Response.Writes for each field and see what you are trying to insert.<BR><BR>You might find some dirty data.<BR><BR>-Doug

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts