Error Handling

S

sbRyguy

Greetings everyone,

I have an ASP page that has two separate forms and a google map. It's
a two step process for the end user, they enter in a prefix in step 1;
a recordset is then built upon the info in step one.

In step two they enter in another 3 numbers that is compared to the
recordset from step1 to produce an ending result and a third recordset
which is then mapped.

I would like to throw a statement in there saying that if the
information from step 2 comes back NULL then throw a javascript
alert.

Step 2 is erroring out on page load which seems to be normal because
no info in step 1 has been passed. But how do I find the error after
form number 2 has been submitted? I develop within a firewall so I
can't post a link but I can post code if someone needs. Any help is
much appreciated.
 
J

Jeff Dillon

Perhaps something similar to:

Response.Write ("<script>Alert('No data');</script>)
 
E

Evertjan.

Jeff Dillon wrote on 19 feb 2008 in
microsoft.public.inetserver.asp.general:
Perhaps something similar to:

Response.Write ("<script>Alert('No data');</script>)

Not similar, as it needs an extra ", Jeff.

in ASP-VBS:

Response.Write "<script>Alert('No data');</script>;"
 
S

sbRyguy

I may have not described it too well;

I'm trying to find an EOF error but the script defaults to EOF because
it's waiting for variables from step1. I need to skip or negate the
first EOF error and then check to see if it fires again.
 
S

sbRyguy

The user inputs values into a form and then on submit, that form
returns a recordset. The second form then is used to parse that
dynamic recordset from step one. If that second form can't come up
with a match from that first dynamic RS then an error should be
thrown. But the EOF error is thrown first.
 
J

Jeff Dillon

If Not Rs.EOF Then...

or

On Error Goto...

And what do you mean "that form returns a recordset". Forms do not return
recordsets
 
A

Adrienne Boswell

Gazing into my crystal ball I observed sbRyguy <[email protected]>
writing in
The user inputs values into a form and then on submit, that form
returns a recordset. The second form then is used to parse that
dynamic recordset from step one. If that second form can't come up
with a match from that first dynamic RS then an error should be
thrown. But the EOF error is thrown first.

<% if request.servervariables("REQUEST_METHOD") = "POST" then
'run my sql statement
else
'just show the page waiting for user input
field = "Default value"
end if
%>
<form method="post" action="<%=request.servervariables
("SCRIPT_NAME")%>">
<div>
<label for="field">Field: </label> <input type="text" name="field"
id="field" value="<%=field%>">
<input type="submit" value="Submit">
</div>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,147
Latest member
CarenSchni
Top