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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 17th, 2003, 08:50 PM
babenchuk babenchuk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 2 babenchuk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Either BOF or EOF is True, or the current record has been deleted

ADODB.Field (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

This is the error I recieve when trying to run my site. I know why. I am passing a non existed URL Parameter. However I would like to recieve a MsgBox that says that such record doesn't exist. Beloe I will paste the source code. Please help. Thank You.

------------------------ Source Code Starts-------------------------------
<%
Dim rsProfile__MMColParam

rsProfile__MMColParam = "1"

If (Request.QueryString("MemID") <> "") Then
rsProfile__MMColParam = Request.QueryString("MemID")
End If

%>
<%
Dim rsProfile
Dim rsProfile_numRows

Set rsProfile = Server.CreateObject("ADODB.Recordset")
rsProfile.ActiveConnection = MM_conn_ued_STRING
rsProfile.Source = "SELECT * FROM ClanMem WHERE MemID = '" + Replace(rsProfile__MMColParam, "'", "''") + "'"
rsProfile.CursorType = 0
rsProfile.CursorLocation = 2
rsProfile.LockType = 1
rsProfile.Open()

rsProfile_numRows = 0
%>

------------------------ Source Code Ends-------------------------------

Reply With Quote
  #2  
Old March 18th, 2003, 09:24 AM
INF INF is offline
Standards User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 146 INF User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 4 sec
Reputation Power: 6
Don't know if this is the best approach, but maybe it will help....

<%
' If there is no ID in the URL string
If (Request.QueryString("MemID") = "") Then
' There is nothing selected, display message
%>
<script language="VBScript">
dim Message
Message=MsgBox("Such record doesn't exist",65,"Error")
document.write(Message)
</script>
<%
End If
%>

I do something similar, except I just write out an error message, as VBScript won't run in Netscape. I guess it just depends on what you're trying to do, but you could even do a simple JavaScript alert.


<script language="JavaScript">
<!--//
alert('Such record doesn\'t exist')
//-->
</script>

Reply With Quote
  #3  
Old March 18th, 2003, 05:13 PM
babenchuk babenchuk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 2 babenchuk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Something else.

Thanks a lot for your help. However you mis-understood what I need. I need that if such a record ("MemID") doesn't exist than display message.

Reply With Quote
  #4  
Old March 19th, 2003, 10:03 AM
INF INF is offline
Standards User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 146 INF User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 4 sec
Reputation Power: 6
Whoops

My bad, wasn't fully absorbing eveything.
You just need to change the if statement to handle the error you're getting
Code:
<% If rsProfile.EOF And rsProfile.BOF Then %>
<script language="VBScript">
dim Message
Message=MsgBox("Such record doesn't exist",65,"Error")
document.write(Message)
</script>
<% End If %>

That way if a non-existent parameter is passed they'll receive the Msgbox.
It appears that you're using Dreamweaver. If you're using MX you can do this by selecting the msgbox code, then on the application panel click the server behavior tab and go to "Show Region" and select "Show Region If recordset is empty"

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Either BOF or EOF is True, or the current record has been deleted


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 2 hosted by Hostway