Forums

This topic is locked

That darn BOF or EOF is True Problem

Posted 03 Oct 2001 06:43:33
1
has voted
03 Oct 2001 06:43:33 Bryan Who posted:
OK I am having the BOF or EOF is True problem.
My page can be seen here. www.htcomp.net/lastingimages/v.3/aspdemo.asp
I will explain what the steps are on the page. When you click on the edit button for the picture it goes to a page that clears the checks for the site and then redirects to another page where you can select a picture to show on the main page.
I am horrible with details so if you need to know anything then let me know.

Alright lets try this again

Replies

Replied 03 Oct 2001 10:27:13
03 Oct 2001 10:27:13 Owen Eastwick replied:
You're not so hot with links either, but I found it. <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>

Post up the code for the <b>editPicture.asp</b> page on which you're getting the BOF / EOF error.

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 03 Oct 2001 18:39:25
03 Oct 2001 18:39:25 Bryan Who replied:
OOOOps! sorry about that

Alright lets try this again

Here is the whole code
MM_editAction = CStr(Request("URL")
If (Request.QueryString &lt;&gt; "" Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%&gt;
&lt;%
' *** Update Record: set variables

If (CStr(Request("MM_update") &lt;&gt; "" And CStr(Request("MM_recordId") &lt;&gt; "" Then

MM_editConnection = MM_connDemo_STRING
MM_editTable = "picts"
MM_editColumn = "ID"
MM_recordId = "" + Request.Form("MM_recordId" + ""
MM_editRedirectUrl = "aspdemo.asp"
MM_fieldsStr = "Yes|value"
MM_columnsStr = "Use|none,'Y','N'"

' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|"
MM_columns = Split(MM_columnsStr, "|"

' set the form values
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(i+1) = CStr(Request.Form(MM_fields(i)))
Next

' append the query string to the redirect URL
If (MM_editRedirectUrl &lt;&gt; "" And Request.QueryString &lt;&gt; "" Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString &lt;&gt; "" Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If

End If
%&gt;
&lt;%
' *** Update Record: construct a sql update statement and execute it

If (CStr(Request("MM_update") &lt;&gt; "" And CStr(Request("MM_recordId") &lt;&gt; "" Then

' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
FormVal = MM_fields(i+1)
MM_typeArray = Split(MM_columns(i+1),","
Delim = MM_typeArray(0)
If (Delim = "none" Then Delim = ""
AltVal = MM_typeArray(1)
If (AltVal = "none" Then AltVal = ""
EmptyVal = MM_typeArray(2)
If (EmptyVal = "none" Then EmptyVal = ""
If (FormVal = "" Then
FormVal = EmptyVal
Else
If (AltVal &lt;&gt; "" Then
FormVal = AltVal
ElseIf (Delim = "'" Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''" & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i &lt;&gt; LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(i) & " = " & FormVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId

If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl &lt;&gt; "" Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

End If
%&gt;
&lt;%
set rsAddPicture = Server.CreateObject("ADODB.Recordset"
rsAddPicture.ActiveConnection = MM_connDemo_STRING
rsAddPicture.Source = "SELECT * FROM picts ORDER BY Use ASC"
rsAddPicture.CursorType = 0
rsAddPicture.CursorLocation = 2
rsAddPicture.LockType = 3
rsAddPicture.Open()
rsAddPicture_numRows = 0
%&gt;
&lt;%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rsAddPicture_numRows = rsAddPicture_numRows + Repeat1__numRows
%&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;/head&gt;
&lt;body bgcolor="#006699" text="#000000"&gt;
&lt;!--#include file="header.inc"--&gt;
&lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;!-- fwtable fwsrc="needa.png" fwbase="asp.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" --&gt;
&lt;tr&gt;
&lt;!-- Shim row, height 1. --&gt;
&lt;td width="30%"&gt;&lt;img src="images/spacer.gif" width="298" height="1" border="0" name="undefined_2"&gt;&lt;/td&gt;
&lt;td width="70%"&gt;&lt;img src="images/spacer.gif" width="113" height="1" border="0" name="undefined_2"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;!-- row 1 --&gt;
&lt;td colspan="2" background="images/divbar.gif"&gt;&lt;img name="divbar" src="images/divbar.gif" width="411" height="5" border="0"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;!-- row 2 --&gt;
&lt;td width="30%"&gt;&lt;img name="aspbar" src="images/aspbar.gif" width="298" height="28" border="0"&gt;&lt;/td&gt;
&lt;td width="70%"&gt;&lt;img name="asp_r2_c2" src="images/asp_r2_c2.gif" width="113" height="28" border="0"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;!-- This table was automatically created with Macromedia Fireworks 4.0 --&gt;
&lt;!-- www.macromedia.com --&gt;
&lt;/table&gt;
&lt;p&gt;Here is where you can change the picture that is viewed.&lt;/p&gt;
&lt;form ACTION="&lt;%=MM_editAction%&gt;" METHOD="POST" name="frmPicture"&gt;
&lt;table width="50%" border="2" cellspacing="0" cellpadding="0" bgcolor="#9999CC" bordercolor="#000066" align="center"&gt;
&lt;tr&gt;
&lt;td width="33%" height="43"&gt;Picture Name&lt;/td&gt;
&lt;td width="45%" height="43"&gt;Image&lt;/td&gt;
&lt;td width="11%" height="43"&gt;Use&lt;/td&gt;
&lt;/tr&gt;
&lt;%
While ((Repeat1__numRows &lt;&gt; 0) AND (NOT rsAddPicture.EOF))
%&gt;
&lt;tr&gt;
&lt;td width="33%"&gt;&lt;%=(rsAddPicture.Fields.Item("PictName".Value)%&gt; &lt;/td&gt;
&lt;td width="45%" bgcolor="#006699"&gt;&lt;img src="images/&lt;%=(rsAddPicture.Fields.Item("FileName".Value)%&gt;"&gt;&lt;/td&gt;
&lt;td width="11%" align="left" valign="middle"&gt;
&lt;input type="radio" name="Yes" value="True"&gt;
Yes &lt;/td&gt;
&lt;/tr&gt;
&lt;%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsAddPicture.MoveNext()
Wend
%&gt;
&lt;tr&gt;
&lt;td width="33%"&gt;
&lt;input type="submit" name="Submit" value="Change"&gt;
&lt;/td&gt;
&lt;td width="45%"&gt;&nbsp; &lt;/td&gt;
&lt;td width="11%"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;input type="hidden" name="MM_recordId"&gt;
&lt;input type="hidden" name="MM_update" value="true"&gt;
&lt;input type="hidden" name="MM_recordId" value="&lt;%= rsAddPicture.Fields.Item("ID".Value %&gt;"&gt;
&lt;/form&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;
&lt;p&gt;&nbsp;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;%
rsAddPicture.Close()
%&gt;

Edited by - Circlecast on 10/03/2001 18:44:10
Replied 09 Oct 2001 04:27:04
09 Oct 2001 04:27:04 Bryan Who replied:
any one have any clues


Alright lets try this again

Reply to this topic