|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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------------------------------- |
|
#2
|
|||
|
|||
|
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> |
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||
|
|||
|
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" |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Either BOF or EOF is True, or the current record has been deleted |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|