Forums
This topic is locked
That darn BOF or EOF is True Problem
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
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 <> "" Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: set variables
If (CStr(Request("MM_update") <> "" And CStr(Request("MM_recordId") <> "" 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 <> "" And Request.QueryString <> "" Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "" Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Update Record: construct a sql update statement and execute it
If (CStr(Request("MM_update") <> "" And CStr(Request("MM_recordId") <> "" 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 <> "" Then
FormVal = AltVal
ElseIf (Delim = "'" Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''" & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i <> 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 <> "" Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
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
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rsAddPicture_numRows = rsAddPicture_numRows + Repeat1__numRows
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#006699" text="#000000">
<!--#include file="header.inc"-->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<!-- fwtable fwsrc="needa.png" fwbase="asp.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
<tr>
<!-- Shim row, height 1. -->
<td width="30%"><img src="images/spacer.gif" width="298" height="1" border="0" name="undefined_2"></td>
<td width="70%"><img src="images/spacer.gif" width="113" height="1" border="0" name="undefined_2"></td>
</tr>
<tr>
<!-- row 1 -->
<td colspan="2" background="images/divbar.gif"><img name="divbar" src="images/divbar.gif" width="411" height="5" border="0"></td>
</tr>
<tr>
<!-- row 2 -->
<td width="30%"><img name="aspbar" src="images/aspbar.gif" width="298" height="28" border="0"></td>
<td width="70%"><img name="asp_r2_c2" src="images/asp_r2_c2.gif" width="113" height="28" border="0"></td>
</tr>
<!-- This table was automatically created with Macromedia Fireworks 4.0 -->
<!-- www.macromedia.com -->
</table>
<p>Here is where you can change the picture that is viewed.</p>
<form ACTION="<%=MM_editAction%>" METHOD="POST" name="frmPicture">
<table width="50%" border="2" cellspacing="0" cellpadding="0" bgcolor="#9999CC" bordercolor="#000066" align="center">
<tr>
<td width="33%" height="43">Picture Name</td>
<td width="45%" height="43">Image</td>
<td width="11%" height="43">Use</td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsAddPicture.EOF))
%>
<tr>
<td width="33%"><%=(rsAddPicture.Fields.Item("PictName".Value)%> </td>
<td width="45%" bgcolor="#006699"><img src="images/<%=(rsAddPicture.Fields.Item("FileName".Value)%>"></td>
<td width="11%" align="left" valign="middle">
<input type="radio" name="Yes" value="True">
Yes </td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsAddPicture.MoveNext()
Wend
%>
<tr>
<td width="33%">
<input type="submit" name="Submit" value="Change">
</td>
<td width="45%"> </td>
<td width="11%"> </td>
</tr>
</table>
<input type="hidden" name="MM_recordId">
<input type="hidden" name="MM_update" value="true">
<input type="hidden" name="MM_recordId" value="<%= rsAddPicture.Fields.Item("ID".Value %>">
</form>
<p> </p>
<p> </p>
</body>
</html>
<%
rsAddPicture.Close()
%>
Edited by - Circlecast on 10/03/2001 18:44:10
Alright lets try this again
Here is the whole code
MM_editAction = CStr(Request("URL")
If (Request.QueryString <> "" Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: set variables
If (CStr(Request("MM_update") <> "" And CStr(Request("MM_recordId") <> "" 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 <> "" And Request.QueryString <> "" Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "" Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Update Record: construct a sql update statement and execute it
If (CStr(Request("MM_update") <> "" And CStr(Request("MM_recordId") <> "" 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 <> "" Then
FormVal = AltVal
ElseIf (Delim = "'" Then ' escape quotes
FormVal = "'" & Replace(FormVal,"'","''" & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i <> 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 <> "" Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
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
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rsAddPicture_numRows = rsAddPicture_numRows + Repeat1__numRows
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#006699" text="#000000">
<!--#include file="header.inc"-->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<!-- fwtable fwsrc="needa.png" fwbase="asp.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
<tr>
<!-- Shim row, height 1. -->
<td width="30%"><img src="images/spacer.gif" width="298" height="1" border="0" name="undefined_2"></td>
<td width="70%"><img src="images/spacer.gif" width="113" height="1" border="0" name="undefined_2"></td>
</tr>
<tr>
<!-- row 1 -->
<td colspan="2" background="images/divbar.gif"><img name="divbar" src="images/divbar.gif" width="411" height="5" border="0"></td>
</tr>
<tr>
<!-- row 2 -->
<td width="30%"><img name="aspbar" src="images/aspbar.gif" width="298" height="28" border="0"></td>
<td width="70%"><img name="asp_r2_c2" src="images/asp_r2_c2.gif" width="113" height="28" border="0"></td>
</tr>
<!-- This table was automatically created with Macromedia Fireworks 4.0 -->
<!-- www.macromedia.com -->
</table>
<p>Here is where you can change the picture that is viewed.</p>
<form ACTION="<%=MM_editAction%>" METHOD="POST" name="frmPicture">
<table width="50%" border="2" cellspacing="0" cellpadding="0" bgcolor="#9999CC" bordercolor="#000066" align="center">
<tr>
<td width="33%" height="43">Picture Name</td>
<td width="45%" height="43">Image</td>
<td width="11%" height="43">Use</td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsAddPicture.EOF))
%>
<tr>
<td width="33%"><%=(rsAddPicture.Fields.Item("PictName".Value)%> </td>
<td width="45%" bgcolor="#006699"><img src="images/<%=(rsAddPicture.Fields.Item("FileName".Value)%>"></td>
<td width="11%" align="left" valign="middle">
<input type="radio" name="Yes" value="True">
Yes </td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsAddPicture.MoveNext()
Wend
%>
<tr>
<td width="33%">
<input type="submit" name="Submit" value="Change">
</td>
<td width="45%"> </td>
<td width="11%"> </td>
</tr>
</table>
<input type="hidden" name="MM_recordId">
<input type="hidden" name="MM_update" value="true">
<input type="hidden" name="MM_recordId" value="<%= rsAddPicture.Fields.Item("ID".Value %>">
</form>
<p> </p>
<p> </p>
</body>
</html>
<%
rsAddPicture.Close()
%>
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
Alright lets try this again