Hola Grupo:
Al estar trabajando con rutina para Accesar a un Archivo de Excel,
visualizandolo en el IE, me envía el siguiente error:
ADODB.Stream (0x800A0BBA)
File could not be opened.
/AccFrontPage/Bajando.asp, line 19
La linea 19 contiene lo siguiente:
oStream.LoadFromFile strRootFile
Los scripts que estoy empleado se los proporciono a continuación:
-
Archivo Baja.asp
<script language="JavaScript">
<!--
function detente() {
if (location.search) {
var xx = location.search
xx=xx.replace("?","")
document.location.replace("Bajando.asp?sURL=../../Documents%20and%20Settings
/Administrador/Mis%20documentos/Download%20Of%20Files%20Intranet/" + xx)
}
}
//-->
</script>
<html>
<body onload="detente()">
</body>
</html>
-
Archivo Bajando.asp
<%
if Request.Form("sURL") = "" then
Call getBinaryFile(Request.QueryString("sURL"))
else
Call getBinaryFile(Request.Form("sURL"))
end if
Function getBinaryFile(strFilePath)
Dim TypeBinary, oStream, strFileName, strRootFile, binFile, nomb, s
if len(strFilePath) > 0 then
set oStream=Server.CreateObject("ADODB.Stream")
strFileName=split(strFilePath,"/") (ubound(split(strFilePath,"/")))
nomb=strFileName
strRootFile=Server.MapPath(strFilePath)
TypeBinary=1
oStream.Open
oStream.Type=TypeBinary
oStream.LoadFromFile strRootFile
binFile = oStream.read
oStream.Flush
if oStream.State = 1 then oStream.close
set oStream = Nothing
Response.Buffer=true
Response.clear
Response.AddHeader "content-disposition", "attachment; filename=" &
nomb
Response.ContentType="application/" & split(nomb,".") (ubound
(split(nomb,".")))
Response.BinaryWrite binFile
end if
End Function
%>
-
Ojala y alguien me ayude :-0
Salu2 :-)
Leer las respuestas