ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

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 ASP Free Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old May 13th, 2008, 05:36 AM
jesushax jesushax is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2007
Posts: 640 jesushax User rank is Sergeant (500 - 2000 Reputation Level)jesushax User rank is Sergeant (500 - 2000 Reputation Level)jesushax User rank is Sergeant (500 - 2000 Reputation Level)jesushax User rank is Sergeant (500 - 2000 Reputation Level)jesushax User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 12 h 30 m 32 sec
Reputation Power: 17
If record does not exist

hi,
what can i put in my if statement to say that this record doesnt exist

example

url: page.asp?ID=1

.asp page
ID= request.querystring("ID")

open recordset sql etc

if recordset("UserID") "does not exist" then

else

endif

so if the id in the querystring does not exist, display a message...

Cheers

Reply With Quote
  #2  
Old May 13th, 2008, 05:48 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,621 Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 7th Grade (Above 100000 Reputation Level)  Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1Folding Points: 325693 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 4 Days 13 h 47 m 29 sec
Reputation Power: 1441
I think we told you that long ago, but here it is again:
Code:
ID= request.querystring("ID")
...
open recordset sql etc
...
If recordset.EOF Then
   'does not exist
Else  
   strID = recordset("UserID")
   ...
End If

the EOF is what you need.

Reply With Quote
  #3  
Old May 13th, 2008, 05:50 AM
micky's Avatar
micky micky is offline
Couch Potato Wizard
Click here for more information. Click here for more information
 
Join Date: Jan 2005
Location: India
Posts: 10,179 micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)micky User rank is General 7th Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 3 Months 3 Weeks 1 Day 16 h 36 m 26 sec
Reputation Power: 1427
u can use end of file
Code:
if recordset.eof then
  'no records
else
  'there r records
end if

you can read about it here
http://www.w3schools.com/ADO/prop_rs_bofeof.asp
__________________
Laziness is my religion and Sunday is my God

Get the Mantra!

Reply With Quote
  #4  
Old May 13th, 2008, 05:50 AM
jesushax jesushax is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Aug 2007
Posts: 640 jesushax User rank is Sergeant (500 - 2000 Reputation Level)jesushax User rank is Sergeant (500 - 2000 Reputation Level)jesushax User rank is Sergeant (500 - 2000 Reputation Level)jesushax User rank is Sergeant (500 - 2000 Reputation Level)jesushax User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 12 h 30 m 32 sec
Reputation Power: 17
ah right yes i knew that... :| sowwi

just forgot for amoment thats how we do it

thanks!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > If record does not exist


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