ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old August 27th, 2003, 12:10 PM
DaronTan DaronTan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Malaysia
Posts: 49 DaronTan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 23 sec
Reputation Power: 5
Send a message via AIM to DaronTan Send a message via MSN to DaronTan Send a message via Yahoo to DaronTan
Question try/catch function???

Does ASP has try/catch function??

For example, if the user accidentaly insert a duplicate data and an error page will exists. so with 'try/catch' function, it display a proper page.


Reply With Quote
  #2  
Old August 27th, 2003, 12:24 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
depends...if you code using javascript as your SERVER-SIDE language then yes you can, look at one the articles at the beginning of Devshed's web site...there is an article about that!

Otherwise, if you use VBScript as your SERVER-SIDE language you might want to look into:


On Error Resume Next

...code...

If Err.Number <> 0 Then
Response.Write "Number : " & Err.Number & "<br>"
Response.Write "Source : " & Err.Source & "<br>"
Response.Write "Description : " & Err.Description& "<br>"
Response.End
End If


But On Error Resume Next is *dangerous* be careful

Hope this helps!
Sincerely

Vlince

Reply With Quote
  #3  
Old August 27th, 2003, 12:28 PM
DaronTan DaronTan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Malaysia
Posts: 49 DaronTan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 23 sec
Reputation Power: 5
Send a message via AIM to DaronTan Send a message via MSN to DaronTan Send a message via Yahoo to DaronTan
So... is there any code that bring the user back to previous page

like this:

if error.number <> 0 then
'back to previous page code'
end if

Reply With Quote
  #4  
Old August 27th, 2003, 12:36 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Well the thing is that it is *YOU* the programmer that controls the flow of things so I don't really understand what you mean by:

---BEGIN QUOTE---
if the user accidentaly insert a duplicate data
---END QUOTE---

How can the *USER* accidentaly do such a thing?
It is *YOU* the programmer that needs to code in such a way that these types of thing doesn't happen no? doesn't that make sense?

I mean, assuming you're making an INSERT statement but for some reason you *might* think that this is an existing record, why don't you make a SELECT *first* then INSERT!

Even better, put everything in a SPROC(Store Procedure) if using SQL Server

That's just a thought!

Hope this helps!
Sincerely

Vlince

Reply With Quote
  #5  
Old August 27th, 2003, 12:41 PM
DaronTan DaronTan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Malaysia
Posts: 49 DaronTan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 23 sec
Reputation Power: 5
Send a message via AIM to DaronTan Send a message via MSN to DaronTan Send a message via Yahoo to DaronTan
well... my problem is like this:

i'm now constructing an admin page which the admin can add quiz questions and answers into database

the interface is similiar like this:

quizNo
Question txtfield
AnswerA txtfield
AnswerB txtfield
Correct Answer txtfield
btnNext

so, each time the admin/user click the 'next' button, the data will be added into database
BUT.... when the admin/user clicked the F5/Refresh button, the duplicate data error page will exist
Any way to fix it???

Reply With Quote
  #6  
Old August 27th, 2003, 12:49 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
What happens after you INSERT the data in your database?

Ok you say it is the users that fill in the questions right?
(well ok the admin also because they have access to the web pages obvioulsy)
But your application is meant to be used by users right?

Ok so the user gets to your ASP page.
Starts answering question#1 then the user clicks on the "NEXT" button, you take the values entered by the user and make an INSERT statement, to create an entry in your database, but then what???

do you send the user to question#2 on another ASP page ???

Assumiong you do, then the user is on the asp page of question#2 so no matter how hard/many times he hits the F5 key it will simply refresh the asp page that is on question#2 so that's not a problem right?

Do you have an hyperlink so that I can see/test it an understand exactly?

Hope this helps!
Sincerely

Vlince

Last edited by Vlince : August 27th, 2003 at 01:11 PM.

Reply With Quote
  #7  
Old August 27th, 2003, 01:09 PM
DaronTan DaronTan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Malaysia
Posts: 49 DaronTan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 23 sec
Reputation Power: 5
Send a message via AIM to DaronTan Send a message via MSN to DaronTan Send a message via Yahoo to DaronTan
Please wait

please wait for a moment, i'm uploading my files

Reply With Quote
  #8  
Old August 27th, 2003, 01:34 PM
DaronTan DaronTan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Malaysia
Posts: 49 DaronTan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 23 sec
Reputation Power: 5
Send a message via AIM to DaronTan Send a message via MSN to DaronTan Send a message via Yahoo to DaronTan
Done!!!


Reply With Quote
  #9  
Old August 28th, 2003, 12:18 AM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
there's a javascript recent history option or something like that....google google goo

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > try/catch function???


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway