Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Stop ASP Page on Error

Reply
Thread Tools

Stop ASP Page on Error

 
 
- Steve -
Guest
Posts: n/a
 
      07-31-2003
How do you do the following?

if(true)
response.write "There was a problem."
***STOP HERE***

more code
more code
more code


 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      07-31-2003
On Error Resume Next

If Err.Number <> 0 Then
Response.Write "There was a problem."
'''close and kill connections/objects; other memory cleanup as necessary
Response.End
End If

Ray at work

"- Steve -" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How do you do the following?
>
> if(true)
> response.write "There was a problem."
> ***STOP HERE***
>
> more code
> more code
> more code
>
>



 
Reply With Quote
 
 
 
 
- Steve -
Guest
Posts: n/a
 
      07-31-2003
Okay perfect. I didn't have the On Error Resume Next, so it was failing
before I could gracefully kill it.

How do I handle this though?

Const LDAP_ALREADY_EXISTS = &h80071392

Set objUser = objOU.Create("User", "CN=" & strFirstName & " " & strLastName)
objUser.Put "samAccountName", strUser
objUser.Set

If Err.Number = LDAP_ALREADY_EXISTS
Then WScript.Echo "The user account already exists."
response.end
End If

The If statment is never true. (It works fine in a regular VB script, but
put it in ASP and it falls apart) If I try to create an account with the
same username it just keeps on going, even outputing the message that the
account was created succesfully (at the end of the script.)



"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%(E-Mail Removed)...
> On Error Resume Next
>
> If Err.Number <> 0 Then
> Response.Write "There was a problem."
> '''close and kill connections/objects; other memory cleanup as

necessary
> Response.End
> End If
>
> Ray at work
>
> "- Steve -" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > How do you do the following?
> >
> > if(true)
> > response.write "There was a problem."
> > ***STOP HERE***
> >
> > more code
> > more code
> > more code
> >
> >

>
>



 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      08-01-2003
I don't know if this is what you'll want, but you could simplify it and do:

On Error Resume Next
Set objUser = GetObject("WinNT://CompOrDomainName/TheUsersSAMname,user")
bUserExists = IsEmpty(objUser)
Set objUser = Nothing
On Error Resume 0

If bUserExists Then
response.write "User exists."
Else
''your code
End If

Ray at home

--
Will trade ASP help for SQL Server help


"- Steve -" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Okay perfect. I didn't have the On Error Resume Next, so it was failing
> before I could gracefully kill it.
>
> How do I handle this though?
>
> Const LDAP_ALREADY_EXISTS = &h80071392
>
> Set objUser = objOU.Create("User", "CN=" & strFirstName & " " &

strLastName)
> objUser.Put "samAccountName", strUser
> objUser.Set
>
> If Err.Number = LDAP_ALREADY_EXISTS
> Then WScript.Echo "The user account already exists."
> response.end
> End If
>
> The If statment is never true. (It works fine in a regular VB script,

but
> put it in ASP and it falls apart) If I try to create an account with the
> same username it just keeps on going, even outputing the message that the
> account was created succesfully (at the end of the script.)
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to stop java service with command line parameter '-stop'? Will Java 1 11-02-2004 03:32 PM
f2.8 vs f3.7- Is it one stop or 2 stop difference zxcvar Digital Photography 12 05-20-2004 06:28 PM
How to stop a thread without using stop() Son KwonNam Java 11 04-09-2004 08:01 PM
Q. My browser doesn't stop, when I click on STOP. Jim Jones Computer Support 7 02-03-2004 09:47 PM
Stop Debugging doesn't stop in ASP.NET Matt Theule ASP .Net 7 07-24-2003 07:38 PM



Advertisments