Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 21st, 2003, 02:28 PM
Registered User
Join Date: Nov 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Server.Execute() Error handling

Im trying to do some error handling when using Server.Execute, when it tries to execute a file that is not found, it isnt returning an error. I dont want to use the file system object to test if the file exists before hand because of the cost of creating the object and doing the test every time the page runs. shouldnt server.execute return an error code if the page is not found?

Reply With Quote
  #2 (permalink)  
Old November 25th, 2003, 02:09 PM
Registered User
Join Date: Nov 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

It seems to work if i do the following, but it doesnt make much sense to me.

If Server.Execute(theFile) Then
  Response.Write("write message here")
End If

The response.write only seems to run when theFile does not exist. Can anyone explain why this works? I have no idea.


Reply With Quote
  #3 (permalink)  
Old April 14th, 2004, 04:45 PM
Registered User
Join Date: Apr 2004
Location: , , Ireland.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

According to Microsoft the Server.Execute method does not have any return values.

I found this to work

public function myfunction
on error resume next

Server.Execute "somefile.asp"
if err.number <> 0 then
 response.write "an error occurred"
end if

end function

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error executing child request(Server.Execute) shivendra012 ASP.NET 2.0 Professional 3 December 31st, 2008 09:32 PM
Error handling with SQL Server mike_remember SQL Server 2000 2 January 2nd, 2007 07:16 PM
Server.Execute muinaru Classic ASP Basics 9 March 13th, 2005 01:36 PM
Server.Execute RobinR Classic ASP Basics 2 October 31st, 2003 11:44 AM

All times are GMT -4. The time now is 06:46 PM.

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