Hi
I am having problems updating my database using a dropdown menu can someone see where I have gone wrong:
Error:
ADODB.Recordset error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/update_style.
asp, line 34
************************************************** *******
drop down form:
<%
'Dimension variables
Dim styConn 'Holds the Database Connection Object
Dim rsstyle 'Holds the recordset for the records in the database
Dim strstyke 'Holds the
SQL query for the database
Dim lngRecordNo2 'Holds the record number to be updated
'Read in the record number to be updated
lngRecordNo2 = Request.QueryString("RemID")
'Create an ADO connection object
Set styConn = Server.CreateObject("ADODB.Connection")
styconn="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=ny database connection is here that's not the problem;"
'Create an ADO recordset object
Set rsstyle = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an
SQL statement to query the database
strstyle = "SELECT memorial.pagestyle FROM memorial where remid=" & lngRecordNo2
'Open the recordset with the
SQL query
rsstyle.Open strstyle, styConn
%>
<form name="form" method="post" action="update_style.
asp?remid=<%=lngRecordNo2%>">
<tr>
<td width="50%">
<select size="5" name="pagestyle" style="width: 95%;" style="border:1px outset #5286A5; " style="border:1px outset #5286A5; " multiple style="border: 1px outset #5286A5">
<option value="Bible">Bible</option>
<option value="boat">boat</option>
<option value="candles">candles</option>
<option value="child1">child1</option>
<option value="child2">child2</option>
<option value="cross">cross</option>
<option value="diary">diary</option>
<option value="footprints">footprints</option>
<option value="heaven1">heaven1</option>
<option value="landscape">landscape</option>
<option value="music">music</option>
<option value="ocean">ocean</option>
<option value="ponga">ponga</option>
<option value="rose">Rose</option>
<option value="rose2">Rose2</option>
<option value="sky">Sky</option>
<option value="toitoi">Toitoi</option>
<option value="valley">Valley</option>
</select></td>
<td width="50%">
<font face="Arial" size="2" color="#5286A5">
Click here to view what each style
template looks like.</font></td>
</tr>
<tr>
<td width="100%" colspan="2" align="center">
<input type="submit" value="Submit New Style" name="style" style="color: #FFFFFF; font-weight: bold; border: 1px solid #5286A5; background-color: #5286A5"></td>
</tr>
</form>
<%
'Reset server objects
rsstyle.Close
Set rsstyle = Nothing
Set styCon = Nothing
%>
************************************************** *
The scripted page after submission:
<!-- #INCLUDE FILE="connection.
asp" -->
<% 'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsUpdateEntry 'Holds the recordset for the record to be updated
Dim strSQL 'Holds the
SQL query to query the database
Dim lngRecordNo 'Holds the record number to be updated
'Read in the record number to be updated
lngRecordNo = CLng(Request.Form("Remid"))
'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using DSN connection
adoCon.Open Connect_String
'Create an ADO recordset object
Set rsUpdateEntry = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an
SQL statement to query the database
strSQL = "SELECT memorial.pagestyle FROM memorial WHERE remid=" & lngRecordNo
'Set the cursor type we are using so we can navigate through the recordset
rsUpdateEntry.CursorType = 2
'Set the lock type so that the record is locked by ADO when it is updated
rsUpdateEntry.LockType = 3
'Open the recordset with the
SQL query
rsUpdateEntry.Open strSQL, adoCon
'Update the record in the recordset
rsUpdateEntry.Fields ("pagestyle") = Request.Form ("pagestyle")
'Write the updated recordset to the database
rsUpdateEntry.Update
DIM strCustomerID
strCustomerID = rsupdateentry("remID")
'Reset server objects
rsUpdateEntry.Close
Set rsUpdateEntry = Nothing
Set adoCon = Nothing
'Return to the update select page in case another record needs deleting
'Response.Redirect "update_select.
asp"
Response.Redirect ("editmemorial.
asp?REMID=") & strcustomerid
%>