Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

server.createobject fails - how to redirect to error page. 2

Status
Not open for further replies.

CMcC

Programmer
Feb 5, 2002
196
US
Hi all. I have .asp page that connects to a .dll that resides on our network that returns a string to a variable called 'buffer'.
Code:
[blue]Set[/blue] mytest = [red]Server.CreateObject[/red]("WEBREPAY.TAXcalc")
[red]buffer[/red] = mytest.[blue]execute[/blue](cmd)
''code to parse the buffer here
''then an include file that shows results of the string:
%>
<!--#INCLUDE [red]FILE[/red]="results.asp"-->
<%
Sometimes the network is unavailable to the server and no data shows in the file 'results.asp'.
The question I have is - when connection to the network .dll fails and the string is empty - Is there a way to redirect the user to a page that says the search is down?
All help is greatly appreciated! THANKS - cmcc
 
You can use the Response.Redirect command in the case that the string is empty.

You can create the page that the application is being redirect to as to have a custom message.

Syntax:
Code:
Response.Redirect("YourURL");

[monkey][snake] <.
 
HI monksnake - I've tried the empty string suggestions but it still doesnt redirect, it goes to the results.asp page. I know the redirect sysntax, but how do I check the empty string?
I've tried:
Code:
1. if empty(buffer) then
2. if buffer.eof then
3. if buffer = NULL then
I guess Im not getting the syntax correct.
I think I need to check whether or not the createobject call fails or not, but not sure of the syntax there.
 
Thanks to you both. That was it.
Happy Easter!
Cmcc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top