p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_howto thread: Stored procedure executes (runs) on open of page


Message #1 by "Ojeda, Donald" <DonaldOjeda@T...> on Thu, 2 Mar 2000 17:18:34 -0500
Try this:

<%
if Len(Trim(Request("AccountNo"))) > 0 then
' ---or you could do: (Trim(Request("AccountNo")) <> "")

Dim SQL 'SQL string
Dim Region 
Dim bFilter
 'if isempty(Request.Form) then	
	

 dim AccountNo
	AccountNo = Request.Form("AccountNo")

	rsRM.CursorLocation = 3
	myConnect.ConnectionTimeout = 300
	myConnect.CommandTimeout = 300
	myConnect.Open Application("Connect_String")
	
'   'Build SQLString
	SQL = "EXEC usp_AIAssetsByRegion '" & (Region) & "'"
	rsRM.Open SQL, myConnect
end if
%>
<HTML>
<HEAD>

<TITLE>Assets By Region</TITLE>

</HEAD>
<body>
<!-- #INCLUDE FILE="Toc2.htm" -->

<TABLE WIDTH=75% ALIGN=center BORDER=0 CELLSPACING=1 CELLPADDING=1>
	<TR>
		<TD ALIGN=middle><B><U><font FACE="Arial" size="5">Assets By
Region</B></U></Font></TD>
	</TR>
</TABLE>
<br>

 <TABLE WIDTH=90% ALIGN=center BORDER=0 CELLSPACING=5 CELLPADDING=0>
	<TR>
	 <form METHOD="Post" ACTION="AssetsByRegion.asp" id="form1"
name="form1">
		<TD width=25%><font FACE="Arial" size="2">Enter
Region:</font></TD>
		<TD width=5%><input NAME="Region"></TD>
		<TD><input TYPE="submit" VALUE="Find" id="SUBMIT1" WIDTH 
"27" HEIGHT = "27"></TD>
		<TD><font FACE="Arial" size="2"></font><Div
Id=TotalAmount>Total Assets: </Div>Total Accounts:
<%=rsRM.RecordCount%></td>
		<!--TD><font FACE="Arial" size="2"></font><Div
Id=TotalAmount>Total Assets: </Div>Total Accounts:
<%=rsRM.RecordCount-1%></td-->
	</TR>
</TABLE>

<hr>
</hr>


<!-- **************************Start New Code ***********************-->
<TABLE Align=center WIDTH=91% BORDER=1 CELLSPACING=1 CELLPADDING=0
bgcolor=white>
<TR bgcolor=darkblue>
<TD width=3% align=middle><font FACE="Arial" size="2" color=white>Advisor
Number</font></TD>
     <TD width=3% align=middle><font FACE="Arial" size="2"
color=white>Account Number</font></TD>
     <TD width=7% align=middle><font FACE="Arial" size="2"
color=white>Region</font></TD>
     <TD width=7% align=middle><font FACE="Arial" size="2"
color=white>Name</font></TD>
	 <TD width=6% align=middle><font FACE="Arial" size="2"
color=white>Market Value</font></TD>
</TR>

</FORM>



Mehul Harry
Software Developer
http://www.Evertek.com
 


  Return to Index