I wish to update some record fields from table DayActivites e.g. the field PLAY (yes or no)
with the following 3 ASP modules
Module 1 : select a record from table Activities
Module 2 : using the selected record from 1 => select the corresponding record in the table DayActivities + make the update(s)
Module 3 : finish update the table DayActivities
However, when I want to display the first (fixed) field (DATE) from the selected record, I does not read the date but the following error :
DATE : ADODB.Field error '80020009'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/STV_aanw_updA.asp, line 0
In this module 2, I use the following code to open the database
<%
'Dimension variables
Dim adoCon '=> Holds the Database Connection Object
Dim rsFFFFTST '=> Holds the recordset for the record to be updated
Dim strSQL '=> Holds the SQL query for the database
Dim lngRecordNo '=> Holds the record number to be updated
'Read in the record number to be updated
lngRecordNo = CLng(Request.QueryString("ActId"))
'=> In the immediately preceding module 1 : the ACTID field (number) is selected from the table Activities with this FrontPage code : value="<%=FP_FieldHTML(fp_rs,"ActId")%>">.
'=> This field ACTID is linked (should be) to the field ACTANID in the table DayActivities, to change the corresponding record
'=> I tested the variable lngRecordNo => response.write (lngRecordNo) gives 0 => I expect a record number ?
'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("_private/FFFF.mdb")
'Create an ADO recordset object
Set rsFFFFTST = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT * FROM activity WHERE ActId=" & lngRecordNo
'Open the recordset with the SQL query
rsFFFFTST.Open strSQL, adoCon
%>
The code for DATE : (the error generator ?)
<tr>
<td>
<b>Datum</b></td>
<td width="377"><font color="red"><b><%=rsFFFFTST("DayActivities.ActDat")%><font color="black"></b>
<input type="hidden" name="Club" value="<% = rsFFFFTST("DayActivities.ActDat") %>">
</td>
</tr>
Thanks for help tips.
(As stated, only Module 1 = FrontPage code - I could also change the FrontPage code of module1 into (pure) ASP code to select a (start) field - My problem: what is the correct code ?)
Unless this would not be enough to solve the problem?
with the following 3 ASP modules
Module 1 : select a record from table Activities
Module 2 : using the selected record from 1 => select the corresponding record in the table DayActivities + make the update(s)
Module 3 : finish update the table DayActivities
However, when I want to display the first (fixed) field (DATE) from the selected record, I does not read the date but the following error :
DATE : ADODB.Field error '80020009'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/STV_aanw_updA.asp, line 0
In this module 2, I use the following code to open the database
<%
'Dimension variables
Dim adoCon '=> Holds the Database Connection Object
Dim rsFFFFTST '=> Holds the recordset for the record to be updated
Dim strSQL '=> Holds the SQL query for the database
Dim lngRecordNo '=> Holds the record number to be updated
'Read in the record number to be updated
lngRecordNo = CLng(Request.QueryString("ActId"))
'=> In the immediately preceding module 1 : the ACTID field (number) is selected from the table Activities with this FrontPage code : value="<%=FP_FieldHTML(fp_rs,"ActId")%>">.
'=> This field ACTID is linked (should be) to the field ACTANID in the table DayActivities, to change the corresponding record
'=> I tested the variable lngRecordNo => response.write (lngRecordNo) gives 0 => I expect a record number ?
'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("_private/FFFF.mdb")
'Create an ADO recordset object
Set rsFFFFTST = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT * FROM activity WHERE ActId=" & lngRecordNo
'Open the recordset with the SQL query
rsFFFFTST.Open strSQL, adoCon
%>
The code for DATE : (the error generator ?)
<tr>
<td>
<b>Datum</b></td>
<td width="377"><font color="red"><b><%=rsFFFFTST("DayActivities.ActDat")%><font color="black"></b>
<input type="hidden" name="Club" value="<% = rsFFFFTST("DayActivities.ActDat") %>">
</td>
</tr>
Thanks for help tips.
(As stated, only Module 1 = FrontPage code - I could also change the FrontPage code of module1 into (pure) ASP code to select a (start) field - My problem: what is the correct code ?)
Unless this would not be enough to solve the problem?