Either EOF or BOF is true, or the current record has been deleted.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramachandradurai
    New Member
    • Sep 2010
    • 1

    #1

    Either EOF or BOF is true, or the current record has been deleted.

    hi, i am getting the error like..


    Either EOF or BOF is true, or the current record has been deleted.Request ed operation requires the current data.



    <%@ LANGUAGE="VBSCR IPT" %>
    <% 'PriceIt.asp (CV Pricing sheet).
    'Project: WEPT
    'Created: 6/11/00
    'Author: CIH

    Option Explicit
    Response.AddHea der "Pragma", "No-cache"
    Response.Expire s = 0
    Response.CacheC ontrol = "no-cache"

    If Trim(Request.Co okies("modyr")) ="" Then
    Response.Redire ct "../MMMYmenu.asp?UR L=CVPricing/PBatchMenu.asp& LevReqd=MMMY"
    End If

    Server.ScriptTi meout=3600
    Response.Buffer = True
    %>

    <!-- #INCLUDE FILE = "../CSLincludes.asp " -->

    <%
    Dim strForm
    Dim strHidden
    Dim strOutput
    Dim objHdrInfo
    Dim rstHdrInfo
    Dim strHdrInfo
    Dim strError
    Dim objCVP
    Dim rstBatchHdr
    Dim rstEntities
    Dim intCounter
    Dim strVATRate
    Dim rstFeatures
    Dim sMarket
    Dim sModelLine
    Dim sModelYear
    Dim objAdmin
    Dim rstCurrencies
    Dim strBatchHdr
    Dim strCur
    Dim strDesc
    Dim strEffDate
    Dim strID

    strHidden = ""
    strForm = ""

    'Get header info
    sMarket = Request.Cookies ( "mkt" )
    sModelLine = Request.Cookies ( "modln" )
    sModelYear = Request.Cookies ( "modyr" )
    Set objAdmin = Server.CreateOb ject("WEPT_DotN et.clsAdmin")
    Call objAdmin.GetHdr Info( CStr( Request.Cookies ( "user" ) ), sMarket, CStr( Request.Cookies ( "lang" ) ), sModelLine, sModelYear )
    Set objAdmin = Nothing

    If Len( sMarket ) = 0 Or Err.number <> 0 Then
    strHdrInfo = "<No description available>"
    Else
    strHdrInfo = sMarket & " " & sModelLine & " " & sModelYear
    End If

    'Get batch header
    If strError = "" Then
    If Request.QuerySt ring("pBatch")= "-1" Then
    strBatchHdr = "New Batch" & vbCRLF
    Else
    Set objCVP = Server.CreateOb ject("WEPT_DotN et.clsCVPricing ")
    If Err <> 0 Then
    strError = "Error creating WEPT object:" & Err.Number & " " & Err.Description
    Else
    Set rstBatchHdr = objCVP.GetBatch Hdr(Request.Coo kies("user"),Re quest.Cookies(" mktISO"), _
    Request.QuerySt ring("pbatch"), _
    Request.QuerySt ring("source"), _
    strError)
    End If
    If strError = "" Then
    If rstBatchHdr.EOF Then
    strBatchHdr = "<No info available>"
    strCur = ""
    strDesc = ""
    strEffDate = ""
    strError = "No data was found for the batch header."
    Else
    strBatchHdr = Request.QuerySt ring("pbatch") & ": " & rstBatchHdr("De sc")
    strCur = rstBatchHdr("Cu r")
    strDesc = rstBatchHdr("De sc")
    strEffDate = rstBatchHdr("Ef fDate")
    End If
    rstBatchHdr.Clo se
    End If
    End If
    End If
    Set rstBatchHdr = Nothing

    If strError = "" Then
    strHidden = strHidden & _
    "<INPUT TYPE='HIDDEN' NAME=txtSrc VALUE='" & Request.QuerySt ring("source") & "'>" & vbCRLF & _
    "<INPUT TYPE='HIDDEN' NAME=txtpBatch VALUE='" & Request.QuerySt ring("pBatch") & "'>" & vbCRLF
    strForm = "<TABLE>" & "<TR>"
    Set objAdmin = Server.CreateOb ject("WEPT_DotN et.clsAdmin")
    Set rstCurrencies = objAdmin.GetCur rencies(Request .Cookies("user" ),Request.Cooki es("mktISO"), strError)
    If strError <> "" Then
    strForm = strForm & "<TD>Curren cy Code: " & _
    "<INPUT TYPE=TEXT SIZE=10 MAXLENGTH=8 NAME=txtCurrenc y VALUE='" & strCur & "'></TD" & vbCRLF
    Else
    strForm = strForm & "<TD>Curren cy: <SELECT NAME=txtCurrenc y>"
    Do While Not rstCurrencies.E OF
    If rstCurrencies(" Code") = strCur Then
    strForm = strForm & "<OPTION VALUE='" & rstCurrencies(" Code") & "' SELECTED>" & rstCurrencies(" Description") & "</OPTION>" & vbCRLF
    Else
    strForm = strForm & "<OPTION VALUE='" & rstCurrencies(" Code") & "'>" & rstCurrencies(" Description") & "</OPTION>" & vbCRLF
    End If
    rstCurrencies.M oveNext
    Loop
    rstCurrencies.C lose
    Set rstCurrencies = Nothing
    strForm = strForm & "</SELECT></TD>" & vbCRLF
    End If
    strForm = strForm & "<TD>Descriptio n: " & _
    "<INPUT TYPE='TEXT' SIZE=20 NAME=txtDesc VALUE=""" & strDesc & """></TD>" & vbCRLF & _
    "<TD>Effect ive Date: " & _
    "<INPUT TYPE='TEXT' SIZE=10 NAME=txtEffDate VALUE=""" & strEffDate & """>(YYYYMM DD)</TD>" & vbCRLF & _
    "<TD>VAT Rate: " & _
    "<INPUT TYPE='TEXT' SIZE=5 NAME=txtMstrVAT VALUE=0></TD>" & vbCRLF & _
    "</TR>" & vbCRLF & _
    "</TABLE>" & vbCRLF & _
    "<BR>" & vbCRLF
    Set objAdmin = Nothing
    End If

    'Begin Entity pricing
    If strError = "" Then
    Set objCVP = Server.CreateOb ject("WEPT_DotN et.clsCVPricing ")
    Set rstEntities = objCVP.GetEntPr icing(Request.C ookies("user"), Request.Cookies ("mktISO"), _
    Request.Cookies ("lang"), _
    Request.Cookies ("modln"), _
    Request.QuerySt ring("pbatch"), _
    Request.QuerySt ring("source"), _
    strError)
    End If

    If strError = "" Then
    strForm = strForm & "<H2><CENTER>En tity Pricing</CENTER></H2>" & vbCRLF
    If Not rstEntities.BOF Then
    strForm = strForm & "<TABLE BORDER VALIGN=CENTER CELLPADDING=1>< TR>" & vbCRLF
    strForm = strForm & "<TD BGCOLOR=#909090 ><FONT COLOR=#ffffff>B odystyle</TD>" & vbCRLF
    strForm = strForm & "<TD BGCOLOR=#909090 ><FONT COLOR=#ffffff>D erivative</TD>" & vbCRLF
    strForm = strForm & "<TD BGCOLOR=#909090 ><FONT COLOR=#ffffff>E ngine</TD>" & vbCRLF
    strForm = strForm & "<TD BGCOLOR=#909090 ><FONT COLOR=#ffffff>T ransmission</TD>" & vbCRLF
    strForm = strForm & "<TD BGCOLOR=#909090 ><FONT COLOR=#ffffff>A xle</TD>" & vbCRLF
    strForm = strForm & "<TD BGCOLOR=#909090 ><FONT COLOR=#ffffff>N et</TD>" & vbCRLF
    strForm = strForm & "</TR>" & vbCRLF
    intCounter = 0
    Do While Not rstEntities.EOF
    'Keep the connection alive
    'Response.Write "<!-- dummy -->"
    'Response.Flush
    strID = CStr(intCounter )
    strHidden=strHi dden & "<INPUT TYPE='HIDDEN' NAME=EECd" & strID & " VALUE='" & rstEntities("En tCode") & "'>" & vbCRLF
    strForm = strForm & "<TR>" & vbCRLF & _
    "<TD>" & FormatTD(rstEnt ities("Bodystyl e"), rstEntities("Bo dyCode")) & "</TD>" & _
    "<TD>" & FormatTD(rstEnt ities("Derivati ve"), rstEntities("De rivCode")) & "</TD>" & _
    "<TD>" & FormatTD(rstEnt ities("Engine") , rstEntities("En gCode")) & "</TD>" & _
    "<TD>" & FormatTD(rstEnt ities("Transmis sion"), rstEntities("Tr ansCode")) & "</TD>" & _
    "<TD>" & FormatTD(rstEnt ities("Axle"), rstEntities("Ax leCode")) & "</TD>"
    If IsNull(rstEntit ies("Net")) Then strOutput = "" Else strOutput = CStr(rstEntitie s("Net"))
    strForm = strForm & "<TD><INPUT TYPE='TEXT' SIZE=10 NAME=ENet" & strID & " VALUE='" & strOutput & "'></TD>" & vbCRLF
    strForm = strForm & "</TR>" & vbCRLF
    If rstEntities("VA T") <> "" And strVATRate = "" Then strVATRate = rstEntities("VA T")
    rstEntities.Mov eNext
    intCounter=intC ounter+1
    Loop
    strHidden=strHi dden & "<INPUT TYPE='HIDDEN' NAME=txtEntRowC ount VALUE='" & intCounter-1 & "'>" & vbCRLF
    rstEntities.Clo se
    Set rstEntities = Nothing
    strForm = strForm & "</TABLE>" & vbCRLF
    End If

    End If

    'Begin Feature Pricing
    If strError = "" Then
    Set objCVP = Server.CreateOb ject("WEPT_DotN et.clsCVPricing ")
    Set rstFeatures = objCVP.GetFeatP ricing(Request. Cookies("user") ,Request.Cookie s("mktISO"), _
    Request.Cookies ("lang"), _
    Request.Cookies ("modln"), _
    Request.QuerySt ring("pbatch"), _
    Request.QuerySt ring("source"), _
    strError)
    End If

    If strError = "" Then
    strForm = strForm & "<H2><CENTER>Fe ature Pricing</CENTER></H2>" & vbCRLF
    If Not rstFeatures.BOF Then
    strForm = strForm & "<TABLE BORDER VALIGN=CENTER CELLPADDING=1>< TR>" & vbCRLF
    strForm = strForm & "<TD BGCOLOR=#909090 ><FONT COLOR=#ffffff>D el?</TD>" & vbCRLF
    strForm = strForm & "<TD BGCOLOR=#909090 ><FONT COLOR=#ffffff>B odystyle</TD>" & vbCRLF
    strForm = strForm & "<TD BGCOLOR=#909090 ><FONT COLOR=#ffffff>F eature</TD>" & vbCRLF
    strForm = strForm & "<TD BGCOLOR=#909090 ><FONT COLOR=#ffffff>N et</TD>" & vbCRLF
    strForm = strForm & "</TR>" & vbCRLF
    intCounter = 0
    Do While Not rstFeatures.EOF
    'Keep the connection alive
    'Response.Write "<!-- dummy -->"
    'Response.Flush
    strID = CStr(intCounter )
    strHidden=strHi dden & "<INPUT TYPE='HIDDEN' NAME=OBCd" & strID & " VALUE='" & rstFeatures("Bo dyCode") & "'>" & vbCRLF
    strHidden=strHi dden & "<INPUT TYPE='HIDDEN' NAME=OFCd" & strID & " VALUE='" & rstFeatures("Fe atCode") & "'>" & vbCRLF
    strForm = strForm & "<TR>" & vbCRLF & _
    "<TD><INPUT TYPE=CHECKBOX NAME=ODel" & strID & " VALUE='Del'></TD>" & _
    "<TD>" & FormatTD(rstFea tures("Bodystyl e"), rstFeatures("Bo dyCode")) & "</TD>" & _
    "<TD>" & rstFeatures("Fe atCode") & ": " & FormatTD(rstFea tures("Feature" ), "No description") & "</TD>"
    If IsNull(rstFeatu res("Net")) Then strOutput = "" Else strOutput = CStr(rstFeature s("Net"))
    strForm = strForm & "<TD><INPUT TYPE='TEXT' SIZE=10 NAME=ONet" & strID & " VALUE='" & strOutput & "'></TD>" & vbCRLF
    strForm = strForm & "</TR>" & vbCRLF
    rstFeatures.Mov eNext
    intCounter=intC ounter+1
    Loop
    strHidden=strHi dden & "<INPUT TYPE='HIDDEN' NAME=txtFeatRow Count VALUE='" & intCounter-1 & "'>" & vbCRLF
    rstFeatures.Clo se
    Set rstFeatures = Nothing
    strForm = strForm & "</TABLE>" & vbCRLF
    strForm = strForm & "<BR><BR><I NPUT TYPE=BUTTON NAME=BtnSubmit VALUE='Save' onClick=""Submi tForm('Normal') ;"">" & vbCRLF
    strForm = strForm & "<INPUT TYPE=button NAME=BtnCancel VALUE='Cancel' onClick='BtnCan cel_OnClick();' >" & vbCRLF
    End If

    End If
Working...