Welcome !
         

 help am stuck with my script

Author Message
ann78

  • Total Posts : 2
  • Scores: 0
  • Reward points : 0
  • Joined: 4/21/2013
  • Status: offline
help am stuck with my script Sunday, April 21, 2013 12:56 AM (permalink)
0
I wonder if anyone might point me to what am doing wrong?
Below is an .ASP VB script that is used to access TIF/PDF  files on a CD/DVD the script works fine and opens the TIF files in the built in TIF viewer , however when I attempt to open a file with the extension PDF I get a line error
Access is denied code 0 line number etc.
It points to:
window.navigate newfilestr
  
I have tried everything I know to make it work but to nothing seem to work
I’ve done document.location , window.location , window.open
But now am at a loss to understand why it wont work .
Reader is installed and I set it up to be both browser integrated and as standalone.
Also I have run all the security settings I can think of
Am I missing something ?????  
thanks
Code:
<% Response.Buffer = true %>
<% Response.Expires = 0   %>
<!-- #INCLUDE FILE="ED_avail.inc" -->
<% ' Source Name : CDnoneTIF.ASP
   ' Purpose     : Allows viewing of non-tif documents either CD or networked based
  
  dim URL, URLX, ApplId, removable, CD, gViewerFileName, DBH, BaseLoc, objConn
  dim DBasePath, RS, DB, FileType
%>
<HTML>
<HEAD>
<TITLE>EDSRS <%=Application("EDSRS_VERSION")%></TITLE>
<LINK rel=stylesheet type="text/css" href=ED_Style.css>
</HEAD>
<!-- #INCLUDE FILE="StubCreate.inc" -->
<%
' now add one to search field in relevant search field in the stats database.
' keeps a check on how many searches are carried out on each database.
  DBH = "Non-Tif-Viewed"
  if Application("StandAlone") = "false" then
%>   
<!-- #INCLUDE FILE="adovbs.inc" -->
<!-- #INCLUDE FILE="statistics.inc" -->
<%
  end if
  removable= Request.QueryString("Remove")
  gViewerFileName = Request.QueryString("File")
  CD = ucase(Request.QueryString("CD"))
  FileType = ucase(Request.QueryString("filetype"))
%>
<SCRIPT language=vbscript>
<!--
sub window_onload
    dim StyleHTML, okvol
    StyleHTML = "<BODY bgcolor=#e8e8e8 text=red><FONT face=Tahoma>"   
 FileType = "<%=FileType%>"   
 if "<%=removable%>" = True then ' this is a CD-based file
  m = split("<%=gViewerFileName%>", "\")
  stub.Disk_ID
  if stub.FileErrDesc = "no error" then ' CD-Rom drive found ok
   stub.cd_volume(stub.i)  
   if not stub.FileError = 71 then
       okvol = 0
    do while (stub.s <> "<%=CD%>" and okvol = 0)
' CD volume label doesn't match one in database - give user option to continue anyway
                    t = msgbox ("Volume label = '" & stub.s & "', expecting '<%=CD%>' - continue anyway ?", vbokcancel, "Volume label mismatch")
                    if t = vbcancel then
         t = msgbox ("Please insert CD " & "<%=CD%>",vbokcancel, "Insert Correct CD")
         if not t = vbcancel then
          stub.cd_volume(stub.i)
                   if stub.FileError = 71 then
                     document.write StyleHTML & "The operation was cancelled."
                    exit sub
                end if
         else ' user pressed Cancel
          document.write StyleHTML & "The operation was cancelled."
          exit sub
         end if
                    else
                        okvol = 1
                    end if
    loop
    newfilestr = stub.i & ":\" & m(1) & "\" & m(2)
    window.navigate newfilestr 
   else ' user pressed Cancel
    document.write StyleHTML & "The operation was cancelled."
    exit sub
   end if        
  else ' CD-Rom drive not found
   select case stub.FileError
    case "5" ' user pressed Cancel
     document.write StyleHTML & "The operation was cancelled."
     exit sub
    case else
     msgbox "Unknown error " & stub.FileError & " has occurred." & chr(13) & _
         "Please try again.  If the problem persists please call the Help Desk on ext 874."
     document.write StyleHTML & "An unknown error has occurred."
     exit sub
   end select
  end if   
 else ' file on networked hard drive, not CD
  if (filetype = "PDF") then
   window.open "[link=file://<%=gViewerFileName%]file://<%=gViewerFileName%[/link]>"
  else
   window.navigate "[link=file://<%=gViewerFileName%]file://<%=gViewerFileName%[/link]>"
  end if
 end if
  
    if (Filetype = "PDF") then
' close window if PDF's - Adobe fires up separately as Helper Application
      window.close
    end if
     
end sub
-->
</SCRIPT>
<BODY>
</BODY>
</HTML>

 
 
 
#1
    59cobalt

    • Total Posts : 2632
    • Scores: 253
    • Reward points : 0
    • Joined: 7/17/2011
    • Status: offline
    Re:help am stuck with my script Sunday, April 21, 2013 6:17 AM (permalink)
    0
    What do the logs (eventlog and IIS logfiles) say about this issue?
     
    #2
      ann78

      • Total Posts : 2
      • Scores: 0
      • Reward points : 0
      • Joined: 4/21/2013
      • Status: offline
      Re:help am stuck with my script Sunday, April 21, 2013 7:39 AM (permalink)
      0
      Am afraid that its not showing anything out of the ordinary in both logs
       
      #3
        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2017 ASPPlayground.NET Forum Version 3.9