Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2007, 02:10 PM
Authorized User
 
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error Type:Server.MapPath(), ASP 0171 (0x80004005)

I'm getting this error :
Error Type:
Server.MapPath(), ASP 0171 (0x80004005)
The Path parameter must be specified for the MapPath method.
/runFile.asp, line 10

here is the code :

<html>

<script language="javascript">

<%

dim runFileName, logFileCreated, physicalPath, logFileName
dim sqlFileName, batchFileName , remoteHost
dim db_conn, db_rec, sql, oraUser, oraPwd, oraService
physicalPath = Server.MapPath(Request.Form("relativePath"))

set fs = Server.CreateObject("Scripting.FileSystemObject")
logFileCreated= 0
sqlFileName = Request.form("sqlFileName")
batchFileName = Request.Form("batchFileName")
remoteHost = Request.Form("remoteHost")

set objScriptShell = Server.CreateObject("WScript.Shell")

if (batchFileName <> "") then
    runFile()
else

  set dbConn = server.createObject("adodb.connection")
  dbConn.open(db_connstr)
  sql = "select userName, password, serviceName from dbConnect where isActive = 1"
  set db_rec = server.createObject("adodb.recordset")
  db_rec.open sql, dbConn

  oraUser = db_rec.Fields(0)
  oraPwd = db_rec.Fields(1)
  oraService = db_rec.Fields(2)

  set db_rec = nothing
  set dbConn = nothing

  runFileName = physicalPath & replace(sqlFileName, "\", "\temp_")
  logFileName = physicalPath & replace(sqlFileName, ".sql", ".log")


  set currFile = fs.createTextFile(runFileName, true)
  currFile.writeLine("@""" & physicalPath & sqlFileName & """")
  currFile.writeLine("exit")
  currFile.close

 objScriptShell.Run "%ComSpec% /c sqlplus " &oraUser& "/"& oraPwd &"@"& oraService &" @""" & runFileName & """ >>""" & logFileName & """", 0, TRUE

 fs.deleteFile(runFileName)
end if




'check if log file has been created
if (fs.fileExists(logFileName)) then
    logFileCreated = 1
end if

sub runFile()
    runFileName = physicalPath & batchFileName
    logFileName = replace(runFileName, ".bat", ".log")

    if (remoteHost <> "") then

        objScriptShell.Run "%ComSpec% /c copy " & runFileName & " \\" & remoteHost & "\c$", 0, TRUE
        objScriptShell.Run Server.mapPath("soon.exe") & " \\" & remoteHost & " 60 c:\" & batchFileName & " >>" & logFileName , 0, TRUE
    else
    objScriptShell.Run "%ComSpec% /c " & runFileName & " >>" & logFileName, 0, TRUE
    //response.write( "%ComSpec% /c " & runFileName & " >>" & logFileName)
    end if
end sub
%>


// set values of fields in form
function load()
{
document.forms['runBatch_Submitform'].logFileCreated.value = "<% response.write(logFileCreated) %>";
document.forms['runBatch_Submitform'].relativePath.value = "<% response.write( replace(Request.Form("relativePath"),"\","\\")) %>";
document.forms['runBatch_Submitform'].projID.value ="<% response.write(Request.Form("projID")) %>";
document.forms['runBatch_Submitform'].action = "operationConsole.asp";
document.forms['runBatch_Submitform'].submit();
}
</script>
<body onLoad="load();">
<form name="runBatch_Submitform" method="post">
    <input type="hidden" name="relativePath" id="relativePath">
    <input type="hidden" name="projID" id="projID">
    <input type="hidden" name="logFileCreated" id="logFileCreated">
</form>
</body>
</html>
[/code]


 
Old April 26th, 2007, 02:24 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there...

maybe this Request.Form("relativePath") comes empty???

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
 
Old April 26th, 2007, 02:28 PM
Authorized User
 
Join Date: Feb 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yeah , i guess ...what can i do about it ? for the time being if I just do
relativePath = Request.Form("relativePath")
physicalPath = Server.MapPath(".") & "\" & relativePath

then i get an error :
Path not found
/runFile.asp, line 47

Line 47 : currFile.writeLine("@""" & physicalPath & sqlFileName & """")
/runFile.asp, line 47







Similar Threads
Thread Thread Starter Forum Replies Last Post
ODBC Error Type 0x80004005 hbansal Classic ASP Professional 22 February 25th, 2009 12:57 AM
Error Type: (0x80004005) Unspecified error wilfree Classic ASP Databases 3 April 3rd, 2007 09:04 AM
ASP-SQL Server Type Mismatched Error ghian72 Pro VB 6 1 July 24th, 2006 05:56 AM
Chapter16 :Server object, ASP 0177 (0x80004005) maybeyou BOOK: Beginning ASP 3.0 0 July 13th, 2006 04:49 AM
Server.MapPath() error 'ASP 0173 : 80004005' nancy Classic ASP Databases 3 September 1st, 2004 03:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.