twocool
04-23-2003, 10:03 AM
i got this problem where i execute the sql it shows
EXEC UpdateApprove 'RQ2003040003, RQ2003040005','2, 2',''
but i want it this way... EXEC UpdateApprove 'RQ2003040003', 'RQ2003040005','2', '2',
this is my code... hope u all can give me an advise....
approve_request.asp
<script language="javascript">
<!--
function submit_form(ReqNo,ReqStatus,RejRemarks,action)
{
document.form2.ReqNo.value = ReqNo;
document.form2.ReqStatus.value = ReqStatus;
document.form2.RejRemarks.value = RejRemarks;
document.form2.dataAction.value = action;
document.form2.submit();
}
//-->
</script>
<% sql= "SELECT * from Requests WHERE ReqtrEmail = '"&Request.ServerVariables("LOGON_USER")&"@singtel.com' "
set rs = MSCS.Execute(sql)%>
<form name="form2" method="post" action="approve_action.asp">
<table width="100%" border="0" cellspacing=0 align="center">
<%Do While Not rs.EOF%>
<tr style="background-color:#EEEEEE;" class="header3">
<td width="15%" height="22">Request No</td>
<td width="25%" height="22">Requestor Name</td>
<td width="15%" height="22">Application System</td>
<td width="20%" height="22">Request Title</td>
<td width="10%" height="22">Request Date</td>
<td width="10%" height="22">Desired Date</td>
<td width="15%" height="22">Action</td>
</tr>
<tr style="background-color:#FFFFCC;" onmouseover="this.style.backgroundColor='#ffcc99';" onmouseout="this.style.backgroundColor='#FFFFCC';" class="text">
<td width="15%"><a href="approve_display.asp?ReqNo=<%=rs("ReqNo")%>" target="_blank", width=500,height=400><%=rs("ReqNo")%></a></td>
<input type="hidden" name="ReqNo" value="<%=rs("ReqNo")%>">
<td width="25%"><span class="txtblack12"><%=rs("Reqtr")%></span></td>
<td width="15%"><span class="txtblack12"><%=rs("AppnId")%></span></td>
<td width="20%"><span class="txtblack12"><%=rs("ReqTitle")%></span></td>
<td width="10%"><span class="txtblack12"><%=Day(rs("ReqDt") )%> /<%=Month(rs("ReqDt") )%> /<%=Year(rs("ReqDt") )%> <%'=rs("ReqDt")%></span></td>
<td width="10%"><span class="txtblack12"><%=Day(rs("DesiredDt") )%> /<%=Month(rs("DesiredDt") )%> /<%=Year(rs("DesiredDt") )%> <%'=rs("DesiredDt")%></span></td>
<td width="15%">
<select name = "ReqStatus">
<option value="2" <%if trim(rs("ReqStatus")) = "2" then%>selected<%end if%>>Approve</option>
<option value="98" <%if trim(rs("ReqStatus")) = "98" then%>selected<%end if%>>Reject</option>
</select>
</td>
</tr>
<tr>
<td width="15%">Reasons For Rejection:</td>
<td width="25%">
<textarea rows="3" cols="45" name="RejRemarks_<%=ReqNo%>" onKeyUp="max_count();" class="txtblack12"></textarea>
</td>
<td width="13%">
<input type="submit" onclick="javascript:submit_form('<%=ReqNo%>','<%=ReqStatus%>','<%=RejRemarks%>','update')" name=Submit value="Submit">
<!--input type="submit" name="Submit" value="Submit"-->
</td>
</tr>
<%rs.MoveNext%>
<%loop%>
</table></form>
<%
rs.close
set rs=nothing
%>
approve_action.asp
<%
'vAppnId = Request("AppnId")
'vReqStatus = Request("ReqStatus")
'vRejRemarks = Request("RejRemarks")
%>
<%
vReqNo = Request("ReqNo")
sql="SELECT * from Requests WHERE ReqNo = '" & vReqNo & "'"
set rs = MSCS.Execute(sql)
rs.close
set rs=nothing
sql="EXEC UpdateApprove '" & vReqNo & "','" &_
trim(Request("ReqStatus")) & "','" &_
trim(Request("RejRemarks")) & "'"
MSCS.execute(sql)
Response.Write sql
Response.End
'redirecturl = "approve_request.asp"
%>
pls help.. i having problem with this..... :(
EXEC UpdateApprove 'RQ2003040003, RQ2003040005','2, 2',''
but i want it this way... EXEC UpdateApprove 'RQ2003040003', 'RQ2003040005','2', '2',
this is my code... hope u all can give me an advise....
approve_request.asp
<script language="javascript">
<!--
function submit_form(ReqNo,ReqStatus,RejRemarks,action)
{
document.form2.ReqNo.value = ReqNo;
document.form2.ReqStatus.value = ReqStatus;
document.form2.RejRemarks.value = RejRemarks;
document.form2.dataAction.value = action;
document.form2.submit();
}
//-->
</script>
<% sql= "SELECT * from Requests WHERE ReqtrEmail = '"&Request.ServerVariables("LOGON_USER")&"@singtel.com' "
set rs = MSCS.Execute(sql)%>
<form name="form2" method="post" action="approve_action.asp">
<table width="100%" border="0" cellspacing=0 align="center">
<%Do While Not rs.EOF%>
<tr style="background-color:#EEEEEE;" class="header3">
<td width="15%" height="22">Request No</td>
<td width="25%" height="22">Requestor Name</td>
<td width="15%" height="22">Application System</td>
<td width="20%" height="22">Request Title</td>
<td width="10%" height="22">Request Date</td>
<td width="10%" height="22">Desired Date</td>
<td width="15%" height="22">Action</td>
</tr>
<tr style="background-color:#FFFFCC;" onmouseover="this.style.backgroundColor='#ffcc99';" onmouseout="this.style.backgroundColor='#FFFFCC';" class="text">
<td width="15%"><a href="approve_display.asp?ReqNo=<%=rs("ReqNo")%>" target="_blank", width=500,height=400><%=rs("ReqNo")%></a></td>
<input type="hidden" name="ReqNo" value="<%=rs("ReqNo")%>">
<td width="25%"><span class="txtblack12"><%=rs("Reqtr")%></span></td>
<td width="15%"><span class="txtblack12"><%=rs("AppnId")%></span></td>
<td width="20%"><span class="txtblack12"><%=rs("ReqTitle")%></span></td>
<td width="10%"><span class="txtblack12"><%=Day(rs("ReqDt") )%> /<%=Month(rs("ReqDt") )%> /<%=Year(rs("ReqDt") )%> <%'=rs("ReqDt")%></span></td>
<td width="10%"><span class="txtblack12"><%=Day(rs("DesiredDt") )%> /<%=Month(rs("DesiredDt") )%> /<%=Year(rs("DesiredDt") )%> <%'=rs("DesiredDt")%></span></td>
<td width="15%">
<select name = "ReqStatus">
<option value="2" <%if trim(rs("ReqStatus")) = "2" then%>selected<%end if%>>Approve</option>
<option value="98" <%if trim(rs("ReqStatus")) = "98" then%>selected<%end if%>>Reject</option>
</select>
</td>
</tr>
<tr>
<td width="15%">Reasons For Rejection:</td>
<td width="25%">
<textarea rows="3" cols="45" name="RejRemarks_<%=ReqNo%>" onKeyUp="max_count();" class="txtblack12"></textarea>
</td>
<td width="13%">
<input type="submit" onclick="javascript:submit_form('<%=ReqNo%>','<%=ReqStatus%>','<%=RejRemarks%>','update')" name=Submit value="Submit">
<!--input type="submit" name="Submit" value="Submit"-->
</td>
</tr>
<%rs.MoveNext%>
<%loop%>
</table></form>
<%
rs.close
set rs=nothing
%>
approve_action.asp
<%
'vAppnId = Request("AppnId")
'vReqStatus = Request("ReqStatus")
'vRejRemarks = Request("RejRemarks")
%>
<%
vReqNo = Request("ReqNo")
sql="SELECT * from Requests WHERE ReqNo = '" & vReqNo & "'"
set rs = MSCS.Execute(sql)
rs.close
set rs=nothing
sql="EXEC UpdateApprove '" & vReqNo & "','" &_
trim(Request("ReqStatus")) & "','" &_
trim(Request("RejRemarks")) & "'"
MSCS.execute(sql)
Response.Write sql
Response.End
'redirecturl = "approve_request.asp"
%>
pls help.. i having problem with this..... :(