2 Replies Latest reply on May 17, 2011 5:12 AM by alphadog7

    One File (Out Of Many) Crashes DW CS5 On Windows

    alphadog7 Level 1

      New system. Fresh install of Win7 x64, CS5, all patches and updates. Was wokring on it fine over a handful of days till one day, it crashed. Since then, opening one particular file and clicking anywhere in the editor will crash DW. In particular, this is a classic ASP page, and clicking anywhere in a <%...%> area with vbscript will result in a crash.

       

      Other files can be opened and worked with just fine.

       

      Cleared the WinFileCache. Opening the file in Notepad++, saving it under a different name, and opening the new file in DW crashes it. (Assuming maybe a weird char or corrupted info was confusing DW.) I've had this happen with other files before.

       

      Error in the crash dump: 0xC0000005 "The thread trie to read from or write to a virtual address for which it does not have the appropriate access."

       

      Here's the code.

       

      <!--#include virtual="/scripts/ASP_common.vbs"-->
      <!--#include virtual="/scripts/iif.vbs"-->
      <!--#include virtual="/scripts/sendEmail.vbs"-->
      <!--#include virtual="/scripts/stripHTML.vbs"-->
      <!--#include virtual="/scripts/concatters.asp"-->
      <%

        VendorName      = ifEmptyString(Left(Trim(stripHTML(Request("VendorName"), null)), 128), null)
        ClientName      = ifEmptyString(Left(Trim(stripHTML(Request("ClientName"), null)), 128), null)
        LocName         = ifEmptyString(Left(Trim(stripHTML(Request("LocName"), null)), 128), null)
        VndActNb        = ifEmptyString(Left(Trim(stripHTML(Request("VndActNb"), null)), 64), null)
        VInvNb          = ifEmptyString(Left(Trim(stripHTML(Request("VInvNb"), null)), 24), null)
        NetworkID       = ifEmptyString(Left(Trim(stripHTML(Request("NetworkID"), null)), 8), null)
        InvDateStart    = ifEmptyString(Request("InvDateStart"), null)
        InvDateEnd      = ifEmptyString(Request("InvDateEnd"), null)
        VInvRcptDtStart = ifEmptyString(Request("VInvRcptDtStart"), null)
        VInvRcptDtEnd   = ifEmptyString(Request("VInvRcptDtEnd"), null)
        UnexpCostMin    = ifEmptyString(Request("UnexpCostMin"), null)
        UnexpCostMax    = ifEmptyString(Request("UnexpCostMax"), null)
        VERStatus       = ifEmptyString(Left(Trim(stripHTML(Request("VERStatus"), null)), 3), null)
        page            = ifEmptyString(Request("page"), null)
        rows            = ifEmptyString(Request("rows"), null)
        sidx            = ifEmptyString(LCase(Request("sidx")), null)
        sord            = ifEmptyString(LCase(Request("sord")), null)
       
        ' allow only 'asc' or 'desc' for @SortOrd
        If Not( sord = "asc" or sord = "desc" or sord = "" ) Then
          setSessionError "Sort order not recognized.", 99
          Response.Redirect( "/system/error.asp" )
          Response.End
        End If
             
        ' allow only known col names for @SortCol
        If Not( _
          sidx = "vname" Or _
          sidx = "vaccnb" Or _
          sidx = "vinvnb" Or _
          sidx = "invdt" Or _
          sidx = "rcpdt" Or _
          sidx = "cspec" Or _
          sidx = "reccur" Or _
          sidx = "cname" Or _
          sidx = "lname" Or _
          sidx = "lstat" Or _
          sidx = "statdt" Or _
          sidx = "reqamt" Or _
          sidx = "cnfamt" Or _
          sidx = "owner" Or _
          sidx = "" _
        ) _
        Then
          Response.Write "ERROR: Sort column not recognized."
          Response.End()
        End If
       
        If Not(IsNull(InvDateStart)) And Not(IsDate(InvDateStart)) Then
          Response.Write "ERROR: InvDateStart not date."
          Response.End()
        End If

        If Not(IsNull(InvDateStart)) And Not(IsDate(InvDateEnd)) Then
          Response.Write "ERROR: InvDateEnd not date."
          Response.End()
        End If
       
        If Not(IsNull(VInvRcptDtStart)) And Not(IsDate(VInvRcptDtStart)) Then
          Response.Write "ERROR: VInvRcptDtStart not date."
          Response.End()
        End If
       
        If Not(IsNull(VInvRcptDtEnd)) And Not(IsDate(VInvRcptDtEnd)) Then
          Response.Write "ERROR: VInvRcptDtEnd not date."
          Response.End()
        End If
       
        If Not(IsNull(UnexpCostMin)) And Not(IsNumeric(UnexpCostMin)) Then
          Response.Write "ERROR: UnexpCostMin not numeric."
          Response.End()
        End If
       
        If Not(IsNull(UnexpCostMax)) And Not(IsNumeric(UnexpCostMax)) Then
          Response.Write "ERROR: UnexpCostMax not numeric."
          Response.End()
        End If

        If Not( _
          VERStatus = "all" Or _
          VERStatus = "opn" Or _
          VERStatus = "par" Or _
          VERStatus = "clg" Or _
          VERStatus = "cln" Or _
          VERStatus = "" _
        ) _
        Then
          Response.Write "ERROR: VERStatus not recognized."
          Response.End()
        End If
       
        If Not(IsNumeric(page)) Then
          Response.Write "ERROR: Page not numeric and not optional."
          Response.End()
        End If
       
        If Not(IsNumeric(rows)) Then
          Response.Write "ERROR: Rows not numeric and not optional."
          Response.End()
        End If

        Set rst = Server.CreateObject("ADODB.Recordset")
        Set con = Server.CreateObject("ADODB.Connection")
        con.Open Application("con_str")
        Set cmd = Server.CreateObject("ADODB.Command")
        cmd.ActiveConnection = con
        cmd.CommandType = adCmdStoredProc
        cmd.CommandText = "cms_getUnexpectedServiceSearch"
        cmd.Parameters.Append = cmd.CreateParameter("@RC", adInteger, adParamReturnValue)
        cmd.Parameters.Append = cmd.CreateParameter("@VendorName", adVarchar, adParamInput, 128, VendorName )
        cmd.Parameters.Append = cmd.CreateParameter("@ClientName", adVarchar, adParamInput, 128, ClientName )
        cmd.Parameters.Append = cmd.CreateParameter("@LocName", adVarchar, adParamInput, 128, LocName )
        cmd.Parameters.Append = cmd.CreateParameter("@VndActNb", adVarchar, adParamInput, 64, VndActNb )
        cmd.Parameters.Append = cmd.CreateParameter("@VInvNb", adVarchar, adParamInput, 24, VInvNb )
        cmd.Parameters.Append = cmd.CreateParameter("@NetworkID", adVarchar, adParamInput, 8, NetworkID )
        cmd.Parameters.Append = cmd.CreateParameter("@InvDateStart", adDBDate, adParamInput, , InvDateStart )
        cmd.Parameters.Append = cmd.CreateParameter("@InvDateEnd", adDBDate, adParamInput, , InvDateEnd )
        cmd.Parameters.Append = cmd.CreateParameter("@VInvRcptDtStart", adDBDate, adParamInput, , VInvRcptDtStart )
        cmd.Parameters.Append = cmd.CreateParameter("@VInvRcptDtEnd", adDBDate, adParamInput, , VInvRcptDtEnd )
        cmd.Parameters.Append = cmd.CreateParameter("@UnexpCostMin", adDecimal, adParamInput, , UnexpCostMin )
        cmd.Parameters("@UnexpCostMin").Precision = 18
        cmd.Parameters("@UnexpCostMin").NumericScale = 6
        cmd.Parameters.Append = cmd.CreateParameter("@UnexpCostMax", adDecimal, adParamInput, , UnexpCostMax )
        cmd.Parameters("@UnexpCostMax").Precision = 18
        cmd.Parameters("@UnexpCostMax").NumericScale = 6
        cmd.Parameters.Append = cmd.CreateParameter("@VERStatus", adVarchar, adParamInput, 3, VERStatus )
        cmd.Parameters.Append = cmd.CreateParameter("@SortCol", adVarchar, adParamInput, 32, sidx )
        cmd.Parameters.Append = cmd.CreateParameter("@SortOrd", adVarchar, adParamInput, 4, sord )
        cmd.Parameters.Append = cmd.CreateParameter("@RowsPerPage", adInteger, adParamInput, , rows )
        cmd.Parameters.Append = cmd.CreateParameter("@PageRequested", adInteger, adParamInput, , page )
        cmd.ActiveConnection.Errors.Clear
        On Error Resume Next
          Set rst = cmd.Execute
        On Error Goto 0
        If con.Errors.Count > 0 Then
          setSessionErrorAndClose con, cmd, null, "Connection errors with database.", 10
          Response.Redirect( "/system/error.asp" )
          Response.End
        End If
       
        If Not rst.EOF Then
          ttl    = rst("Pages").Value
          recs   = rst("Rows").Value
         
          Set str = New StrConCatArray
         
          str.Add "{""page"":"""
          str.Add ifNull(page, "")
          str.Add """,""total"":"""
          str.Add ifNull(ttl, "")
          str.Add """,""records"":"""
          str.Add ifNull(recs, "")
          ' data rows
          str.Add """,""rows"":["
          Do While Not rst.EOF
            str.Add "{""id"":"""
            str.Add ifNull(rst("ID").Value, "")
            str.Add """,""cell"":["""
            'vname'
            str.Add ifNull(rst("VendorName").Value, "")
            str.Add ""","""
            'vaccnb'
            str.Add ifNull(rst("VndActNb").Value, "")
            str.Add ""","""
            'vinvnb'
            str.Add ifNull(rst("VInvNb").Value, "")
            str.Add ""","""
            'invdt'
            str.Add format(rst("InvDate").Value,"Y-m-d")
            str.Add ""","""
            'rcpdt'
            str.Add format(rst("VInvRcptDt").Value,"Y-m-d")
            str.Add ""","""
            'cspec'
            str.Add ifNull(rst("CodeSpecifier").Value, "")
            str.Add ""","""
            'reccur'
            str.Add ifNull(rst("Recurrence").Value, "")
            str.Add ""","""
            'cname'
            str.Add ifNull(rst("ClientName").Value, "")
            str.Add ""","""
            'lname'
            str.Add ifNull(rst("LocName").Value, "")
            str.Add ""","""
            'lstat'
            str.Add ifNull(rst("RecentLocStatus").Value, "")
            str.Add ""","""
            'statdt'
            str.Add format(rst("RecentLocStatusDate").Value,"Y-m-d")
            str.Add ""","""
            'reqamt'
            str.Add ifNull(rst("UnexpCost").Value, "")
            str.Add ""","""
            'cnfamt'
            str.Add ifNull(rst("ConfirmedAmt").Value, "")
            str.Add ""","""
            'owner'
            str.Add ifNull(rst("NetworkID").Value, "")
            str.Add """]},"
            rst.MoveNext
          Loop
          str.Add "]}"
          body = Replace(str.Value, "]},]}", "]}]}")
          Response.Write body
        Else
          ' no data
          Response.Write "{""page"":""0"",""total"":""0"",""records"":""0"",""rows"":[]}"   
        End If
        closeAndErase con, cmd, rst
      %>