I have a database in Access. Scripting in asp.
BACKGROUND
Each user can only view infor for a billNo from their designated “area”. Eg Joe from the audit dept can view billNO HB0030 from the audit dept. However the same billNo HB0030 also appears in another dept say Fin. So users in the fin dept can also see the same billNo.
Therefore I have a login page (login.asp)where user is authenticated , dept determined and user sent to their dept page. This dept page(dept.asp) is a list of billNo assigned to that dept and a few details /infor for that bill no. each billNO on this dept page is a hyperlink, which takes you to another page (submitpage.asp) with more detailed information about the bill where also infor can be entered and submitted by user
The page where I have this error message is the (submitpage.asp) which
like I had said is a display of information regarding a bill selected from the previous page(dept.asp).hence the FIRSTSql query
It also displays the other "area" where that same bill no appears as in the 2NDsqlquery .
However I get an error on line 7- RS.Open SQLQuery ,Conn,1,1
why??
<%
billNO = request.querystring("billNo")
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("adodb.Recordset")
Conn.Open "eiwp"
SQLQuery = "SELECT * FROM tblopgaCOm2 WHERE billNo = "& billNo
RS.Open SQLQuery ,Conn,1,1
strBillNo=RS("billNo")
SQLQuery1= "Select area FROM tblopgaCOm2 WHERE billNo = '"&strBillNo&"'"
Set RS1=Conn.Execute(SQLQuery1)
%>
<form method="POST" action="legconfirm.asp" >
<td width="155%" bgcolor="#C0C0C0" height="36" colspan="5"><b><font size="2">
BILL</font>#</b> <b><font color="#000080">
<input type="text" name="billNo" style="background-color: #D2D2D2; font-weight: bold; color: #000080" size="9" value="<%=RS("billNo")%>" readonly></font></b> <font size="2"><b> <b><font color="#000080">
<b>AREA<input type="text" name="area" style="background-color: #D2D2D2; color: #000080; font-weight: bold; text-align: Left" size="8" value="<%=RS("area")%>" readonly>
<b>OTHER AREARS FOR COMMENTS</b></font><b><font size="2">:</font></b></td>
<td width="159%" bgcolor="#E6E3E4" height="36" colspan="4">
<textarea rows="2" name="otherdescription" readonly style="background-color: #D2D2D2" cols="27">
<% Do Until RS1.EOF
Response.write RS1("area")&","
RS1.MoveNext
Loop
RS1.Close
%>
</textarea>
</td>
</tr>
<tr>
<td width="23%" bgcolor="#C0C0C0" height="36"><b><font size="2">COMMENTS:</font></b></td>
<td width="159%" bgcolor="#E6E3E4" height="36" colspan="4"><textarea rows="3" name="comments" cols ="50"><%=RS("comments")%></textarea>
<td width="142%" height="36"> </td>
<tr>
BACKGROUND
Each user can only view infor for a billNo from their designated “area”. Eg Joe from the audit dept can view billNO HB0030 from the audit dept. However the same billNo HB0030 also appears in another dept say Fin. So users in the fin dept can also see the same billNo.
Therefore I have a login page (login.asp)where user is authenticated , dept determined and user sent to their dept page. This dept page(dept.asp) is a list of billNo assigned to that dept and a few details /infor for that bill no. each billNO on this dept page is a hyperlink, which takes you to another page (submitpage.asp) with more detailed information about the bill where also infor can be entered and submitted by user
The page where I have this error message is the (submitpage.asp) which
like I had said is a display of information regarding a bill selected from the previous page(dept.asp).hence the FIRSTSql query
It also displays the other "area" where that same bill no appears as in the 2NDsqlquery .
However I get an error on line 7- RS.Open SQLQuery ,Conn,1,1
why??
<%
billNO = request.querystring("billNo")
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("adodb.Recordset")
Conn.Open "eiwp"
SQLQuery = "SELECT * FROM tblopgaCOm2 WHERE billNo = "& billNo
RS.Open SQLQuery ,Conn,1,1
strBillNo=RS("billNo")
SQLQuery1= "Select area FROM tblopgaCOm2 WHERE billNo = '"&strBillNo&"'"
Set RS1=Conn.Execute(SQLQuery1)
%>
<form method="POST" action="legconfirm.asp" >
<td width="155%" bgcolor="#C0C0C0" height="36" colspan="5"><b><font size="2">
BILL</font>#</b> <b><font color="#000080">
<input type="text" name="billNo" style="background-color: #D2D2D2; font-weight: bold; color: #000080" size="9" value="<%=RS("billNo")%>" readonly></font></b> <font size="2"><b> <b><font color="#000080">
<b>AREA<input type="text" name="area" style="background-color: #D2D2D2; color: #000080; font-weight: bold; text-align: Left" size="8" value="<%=RS("area")%>" readonly>
<b>OTHER AREARS FOR COMMENTS</b></font><b><font size="2">:</font></b></td>
<td width="159%" bgcolor="#E6E3E4" height="36" colspan="4">
<textarea rows="2" name="otherdescription" readonly style="background-color: #D2D2D2" cols="27">
<% Do Until RS1.EOF
Response.write RS1("area")&","
RS1.MoveNext
Loop
RS1.Close
%>
</textarea>
</td>
</tr>
<tr>
<td width="23%" bgcolor="#C0C0C0" height="36"><b><font size="2">COMMENTS:</font></b></td>
<td width="159%" bgcolor="#E6E3E4" height="36" colspan="4"><textarea rows="3" name="comments" cols ="50"><%=RS("comments")%></textarea>
<td width="142%" height="36"> </td>
<tr>