booboo0912
Programmer
Hello! I'm trying to update a database using a form, and I've looked at many examples, but can't figure out why my code isn't working. I'm using ASP and JScript, but the examples I've seen are using VBScript, so I'm trying to translate into JScript. I've only gotten as far as filtering the records to the one that needs to be updated, and now I'm trying to set up the form to put the data in text boxes so the data can be updated.
Here's where I'm stuck:
<%
FindTime = Request.QueryString("FindTime"
;
conn = Server.CreateObject("ADODB.Connection"
;
conn.Open(Application("CONN_STR"
);
rs = Server.CreateObject("ADODB.Recordset"
;
sSQL = "Select b.Time, a.Appt1, a.Appt2, a.Appt3, a.Appt4 From tblSubCholesterol a join tblCholesterol b on b.TimeID and b.Time = " + "'" + Request.Form("FindTime"
+ "'";
rs.Open(sSQL, conn);
strAppt1 = rs("Appt1"
;
strAppt2 = rs("Appt2"
;
strAppt3 = rs("Appt3"
;
strAppt4 = rs("Appt4"
;
%>
When I try to display a field using a simple alert box:
<script language="Javascript">
alert(<%=strAppt1%>);
</script>
I get an error message saying: "Error Type: ADODB.Field
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires current record."
What am I doing wrong?? I appreciate any help!!
Thanks!
T
Here's where I'm stuck:
<%
FindTime = Request.QueryString("FindTime"
conn = Server.CreateObject("ADODB.Connection"
conn.Open(Application("CONN_STR"
rs = Server.CreateObject("ADODB.Recordset"
sSQL = "Select b.Time, a.Appt1, a.Appt2, a.Appt3, a.Appt4 From tblSubCholesterol a join tblCholesterol b on b.TimeID and b.Time = " + "'" + Request.Form("FindTime"
rs.Open(sSQL, conn);
strAppt1 = rs("Appt1"
strAppt2 = rs("Appt2"
strAppt3 = rs("Appt3"
strAppt4 = rs("Appt4"
%>
When I try to display a field using a simple alert box:
<script language="Javascript">
alert(<%=strAppt1%>);
</script>
I get an error message saying: "Error Type: ADODB.Field
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires current record."
What am I doing wrong?? I appreciate any help!!
Thanks!
T