#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Posts
    74
    Rep Power
    26

    ASP page problem


    Hi Guys!

    Please help me, i am in a very big problem, i have a very little knowledge of ASP Classic. But i have to correct one page that is showing me a problem, here are the details of its error.
    -------------------------------------------------------
    Microsoft VBScript runtime error '800a000d'

    Type mismatch: 'rs1'

    /BH/View_Cart.Asp, line 309
    --------------------------------------------------------
    I have checked an insight look as per my knowledge but i didn't find any error. I sometimes replace codes, one part of the code disappear and others appear and then again other disappear and third appear. But nothing.

    Here is tha code of the page....
    Code:
    <%@ language="vbscript"%>
    
    <!--#include file="Bh_Conn.txt"  -->
    
    <%
    AspUserId = Session("User")
    AspPrId = Session("PrId")
    
    if AspUserId = "" then 
    ErrMsg = "Session Expired! Please Login again"
    Response.redirect "Login.Asp?E="&ErrMsg&""
    response.end
    
    end if
    
    
    qry1 = "select * from User_info where UserId = "&AspUserId&" "
    set rs1=conn.execute(qry1)
    
    
    qry2 = "select * from PrDinfo where PrId = '"&AspPrId&"' "
    set rs2=conn.execute(qry2)
    
    qry200 = "select * from PrDinfo where PrId = '"&AspPrId&"' "
    set rs200=conn.execute(qry200)
    
    			AspPr1 = 0
    			if not rs200.eof then
    			while not rs200.eof
    			AspPr1 = Rs200("ItemPrice") + AspPr1
    			rs200.movenext
    			wend
    			end if
    			
    
    
    qry3 = "select * from Prinfo where PrId = '"&AspPrId&"' "
    set rs3=conn.execute(qry3)
    
    'qry4 = "SELECT Sum(PrAmount) AS UsedBudget FROM PrInfo where UserId = "&AspUserId&" "
    qry4 = "SELECT Sum(PrAmount) AS UsedBudget FROM PrInfo where PoNo = '"&rs3("PoNo")&"' "
    set rs4=conn.execute(qry4)
    
    if not rs4.eof then
    
    AspUsedBudget = rs4("UsedBudget")
    else
    AspUsedBudget = 0
    end if
    
    'AspAvailableBudget = rs1("BudgetLimit") - AspUsedBudget
    qry11 = "select * from User_info where PoNo = '"&rs3("PoNo")&"' "
    set rs11=conn.execute(qry11)
    AspAvailableBudget = rs11("BudgetLimit") - AspUsedBudget
    
    
    
    
    %>
    
    
    <HTML>
    <HEAD>
    <TITLE>Bahamdoon Trading Est.</TITLE>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
    <style type="text/css">
    <!--
    img {
    	border: none;
    }
    .tah10 {
    	font-family: Tahoma;
    	font-size: 10px;
    	text-decoration: none;
    	color: #000000;
    }
    .tah11 {
    	font-family: Tahoma;
    	font-size: 11px;
    	text-decoration: none;
    	color: #000000;
    }
    .ver10 {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 10px;
    	text-decoration: none;
    	color: #000000;
    }
    .ver11 {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 11px;
    	text-decoration: none;
    	color: #000000;
    }
    .tah9 {
    	font-family: Tahoma;
    	font-size: 9px;
    	text-decoration: none;
    	color: #000000;
    }
    .ver9 {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 9px;
    	text-decoration: none;
    	color: #000000;
    }
    -->
    </style>
    <style type="text/css">
    <!--
    .tahbol {
    	font-family: Tahoma;
    	font-size: 10px;
    	text-decoration: none;
    	color: A6B43B;
    	font-weight: bold;
    }
    -->
    </style>
    <style type="text/css">
    <!--
    .bgtop {
    	background-repeat: no-repeat;
    	background-position: top;
    }
    -->
    </style>
    <script language="JavaScript" fptype="dynamicanimation">
    <!--
    function dynAnimation() {}
    function clickSwapImg() {}
    //-->
    </script>
    <script language="JavaScript1.2" fptype="dynamicanimation" src="../animate.js">
    </script>
    </HEAD>
    <BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 onload="dynAnimation()" language="Javascript1.2">
    <!-- ImageReady Slices (0005_red.psd - Slices: 03, 04, 05) -->
    <TABLE WIDTH=100% height="100%" BORDER=0 CELLPADDING=0 bgcolor="#FFFFFF" bordercolor="#00FF00" cellspacing="0">
    	<TR>
    		<TD width="50%" rowspan="2" background="images/bg.gif" bgCOLOR="#E1EBF2">&nbsp;</TD>
    		<td width="1" bgcolor="#000000" rowspan="2"><img src="images/spacer.gif" width="1" height="1"></td>
        <TD> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="780" height="219">
            <param name="movie" value="flash/0347_main.swf">
            <param name="quality" value="high">
            <embed src="flash/0347_main.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="780" height="219"></embed></object>	
        </TD>
    		<td width="1" bgcolor="#000000" rowspan="2"><img src="images/spacer.gif" width="1" height="1"></td>
    		<TD width="50%" rowspan="2" background="images/bg.gif" bgCOLOR="#E1EBF2">&nbsp;</TD>
    	</TR>
    	<TR>
    		<TD height="100%" valign="top">
    <table border="0" width="100%" cellspacing="0" cellpadding="0" style="font-size: 8pt; font-family: Tahoma; color: #2F94EE">
    	<tr>
    		<td width="30%" colspan="2" height="60" background="images/h1.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    				</td>
    		<td width="35%" bgcolor="#F6F6F6" valign="top">
    		<table border="0" width="100%" cellspacing="1" style="font-family: Tahoma; font-size: 10pt; color: #FF8A00; font-weight: bold">
    			<tr>
    				<td height="32" background="images/h4.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    				<font size="3"><b>Corporate Buyer Home</b></font></td>
    			</tr>
    		</table>
    		</td>
    		<td width="35%" bgcolor="#F6F6F6" align="right" valign="top">&nbsp;	<!--#include file="Top_menu.txt"  -->
    				&nbsp;</td>
    	</tr>
    	<tr>
    		<td width="3%" background="images/accnt.gif" valign="top">&nbsp;</td>
    		<td width="97%" valign="top" colspan="3">
    		<table border="0" width="100%" cellspacing="0" cellpadding="0">
    			<tr>
    				<td>
    						
    </td>
    			</tr>
    			</table>
    		<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript" Type="text/javascript"><!--
    function FrontPage_Form1_Validator(theForm)
    {
    
      if (theForm.txtCcntr.value == "")
      {
        alert("Please enter a value for the \"Cost Center\" field.");
        theForm.txtCcntr.focus();
        return (false);
      }
    
      if (theForm.txtSsrs.value == "")
      {
        alert("Please enter a value for the \"SSRS No.\" field.");
        theForm.txtSsrs.focus();
        return (false);
      }
      return (true);
    }
    //--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="Ccntr_Update.Asp" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">
    		<table border="1" width="100%" cellspacing="3" cellpadding="2" bordercolor="#EAEAEA" style="font-family: Tahoma; font-size: 8pt; color: #2F94EE">
    			<tr>
    				<td colspan="3"><b><font size="2">My Shopping cart</font></b></td>
    			</tr>
    			<tr>
    				<td width="20%" bordercolor="#FFFFFF">Affiliate :</td>
    				<td width="35%" bordercolor="#FFFFFF"><b>&nbsp;<%=rs1("UCompName")%></b></td>
    				<td width="35%" rowspan="7"><font color="#FF0000"><%=request("Er")%></font>&nbsp;</td>
    			</tr>
    			<%
    				if rs1("PoFlag") = True then
    				
    				qry10="Select * from User_Info where PoFlag = True order by UCompName"
    				set rs10=conn.execute(qry10)
    
    			%>
    			
    			<tr>
    				<td width="20%" bordercolor="#FFFFFF">Affiliate PR/PO No. :</td>
    				<td width="35%" bordercolor="#FFFFFF">
    				<select size="1" name="txtPoNo">
    					<option value="<%=rs3("PoNo")%>"><%=Left((rs3("PoNo")),10)%></option>
    		
    			
    				<%
    				if not rs10.eof then
    				while not rs10.eof
    	
    				%>
    				<option value="<%=rs10("PoNo")%>"><%=Left((rs10("PoNo")),10)%> (<%=rs10("UCompName")%>)</option>
    				<%
    				rs10.movenext
    				wend
     				end if
    				%>
    				</select></td>
    			</tr>
    			
    			<%
    			else
    			%>
    			
    			<tr>
    				<td width="20%" bordercolor="#FFFFFF">Affiliate PR/PO No. :</td>
    				<td width="35%" bordercolor="#FFFFFF">
    					&nbsp;<select size="1" name="txtPoNo">
    					<option value="<%=rs1("PoNo")%>"><%=Left((rs1("PoNo")),10)%></option>
    				
    				
    				</td>
    			</tr>
    			<%end if%>
    			<tr>
    				<td width="20%" bordercolor="#FFFFFF">Budget Limit:</td>
    				<td width="35%" bordercolor="#FFFFFF"><b>&nbsp;SR.&nbsp;<%=rs11("BudgetLimit")%></b></td>
    			</tr>
    			<tr>
    				<td width="20%" bordercolor="#FFFFFF">Available Balance :</td>
    				<td width="35%" bordercolor="#FFFFFF"><b>&nbsp;SR.&nbsp;<%=AspAvailableBudget%></b></td>
    			</tr>
    			<tr>
    				<td width="20%" bordercolor="#FFFFFF">New Balance :  </td>
    				<td width="35%" bordercolor="#FFFFFF"><b>&nbsp;SR.&nbsp;<%=AspAvailableBudget - AspPr1%></b></td>
    			</tr>
    			<tr>
    				<td width="20%" bordercolor="#FFFFFF">Purchase request Number :  </td>
    				<td width="35%" bordercolor="#FFFFFF"><b>&nbsp;<%=AspprId%></b></td>
    			</tr>
    			<tr>
    				<td width="20%" bordercolor="#FFFFFF">Cost Center :</td>
    				<td width="35%" bordercolor="#FFFFFF">
    					&nbsp;<!--webbot bot="Validation" s-display-name="Cost Center" b-value-required="TRUE" --><input type="text" name="txtCcntr" size="20" value="<%=rs3("PrCcntr")%>">
    					
    &nbsp;</td>
    			</tr>
    			<tr>
    				<td width="20%" bordercolor="#FFFFFF">SSRS : </td>
    				<td width="35%" bordercolor="#FFFFFF">
    					&nbsp;<!--webbot bot="Validation" s-display-name="SSRS No." b-value-required="TRUE" --><input type="text" name="txtSsrs" size="20" value="<%=rs3("PrSsrs")%>"></td>
    				<td width="35%">
    		
    <input type="submit" value="Request Order" name="B1"></td>
    			</tr>
    		</table>
    		
    				<input type="hidden" name="PrId" value="<%=AspprId%>">
    		
    				</form>
    		
    		
    		&nbsp;</td>
    	</tr>
    	<tr>
    		<td width="3%" background="images/accnt.gif">&nbsp;</td>
    		<td width="97%" colspan="3">
    	
    	
    		<table border="1" width="100%" style="font-family: Tahoma; font-size: 8pt; color: #2F94EE" bordercolor="#C0C0C0">
    			<tr>
    				<td width="5%" bgcolor="#C0C0C0"><b>S. No.</b></td>
    				<td width="35%" bgcolor="#C0C0C0"><b>Product Name / Description</b></td>
    				<td width="15%" bgcolor="#C0C0C0"><b>Brand</b></td>
    				<td width="10%" bgcolor="#C0C0C0"><b>Price (SR)</b></td>
    				<td width="10%" bgcolor="#C0C0C0"><b>Quantity</b></td>
    				<td width="10%" bgcolor="#C0C0C0"><b>Total (SR)</b></td>
    				<td width="15%" bgcolor="#C0C0C0">&nbsp;</td>
    			</tr>
    			<%
    			AspSn = 0
    			AspPr = 0
    			if not rs2.eof then
    			while not rs2.eof
    			AspSn = AspSn + 1
    			AspPr = Rs2("ItemPrice") + AspPr
    			
    			qry21="Select * from Product_Info where ProductId = "&rs2("itemId")&" "
    			set rs21=conn.execute(qry21)
    			
    			%>
    			<tr>
    				<td width="5%" bgcolor="#FFFFFF" align="center">&nbsp;<%=AspSn%></td>
    				<td width="35%" bgcolor="#FFFFFF">&nbsp;<%=rs21("productName")%></td>
    				<td width="15%" bgcolor="#FFFFFF">&nbsp;<%=rs21("Brand")%></td>
    				<td width="10%" bgcolor="#FFFFFF" align="center">&nbsp;<%=rs21("MRP")%></td>
    				<td width="10%" bgcolor="#FFFFFF" align="center">&nbsp;<%=rs2("ItemQty")%></td>
    				<td width="10%" bgcolor="#FFFFFF" align="center">&nbsp;<%=rs2("ItemPrice")%></td>
    				<td width="15%" bgcolor="#FFFFFF"><a href="RemoveItem.Asp?Prd=<%=rs2("prdId")%>">
    				Remove Item</a></td>
    			</tr>
    			<%
    			rs2.movenext
    			wend
    			
    						End if
    
    %>
    
    			<tr>
    				<td width="100%" colspan="7" align="right" bgcolor="#FFFFFF">&nbsp;
    				</td>
    			</tr>
    
    <%			
    
    			%>
    			<tr>
    				<td width="86%" colspan="6" align="right" bgcolor="#FFFFFF">
    				Total No. of Items :</td>
    				<td width="14%" align="center" bgcolor="#FFFFFF"><b>&nbsp;<%=AspSn%></b></td>
    			</tr>
    			<tr>
    				<td width="86%" colspan="6" align="right" bgcolor="#FFFFFF">Grand Total : </td>
    				<td width="14%" align="center" bgcolor="#FFFFFF">SR.<b> <%=AspPr%></b></td>
    			</tr>
    			</table>
    		</td>
    	</tr>
    	<tr>
    		<td width="3%" background="images/accnt.gif">&nbsp;</td>
    		<td width="27%">&nbsp;</td>
    		<td width="35%">&nbsp;</td>
    		<td width="35%">&nbsp;</td>
    	</tr>
    	<tr>
    		<td width="100%" background="images/bh_footer2.jpg" colspan="4" height="100">
    <table border="0" width="80%" align="right" style="font-family: Tahoma; font-size: 8pt; color: #4675BE; font-weight: bold">
    	<tr>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    	</tr>
    	<tr>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    		<td align="center">&nbsp;</td>
    	</tr>
    	<tr>
    		<td align="center"><b>
    		<a href="index.html" style="text-decoration: none" dynamicanimation="fpAnimformatRolloverFP1" fprolloverstyle="font-family: Tahoma; color: #4675BE; text-decoration: underline; font-size: 8pt; font-weight: bold" onmouseover="rollIn(this)" onmouseout="rollOut(this)" language="Javascript1.2">
    		<font color="#4675BE">Home</font></a></b></td>
    		<td align="center">::</td>
    		<td align="center"><b>
    		<a href="about_us.Asp" style="text-decoration: none" dynamicanimation="fpAnimformatRolloverFP1" fprolloverstyle="font-family: Tahoma; color: #4675BE; text-decoration: underline; font-size: 8pt; font-weight: bold" onmouseover="rollIn(this)" onmouseout="rollOut(this)" language="Javascript1.2">
    		<font color="#4675BE">About Us</font></a></b></td>
    		<td align="center">::</td>
    		<td align="center"><b>
    		<a href="contact_us.Asp" style="text-decoration: none" dynamicanimation="fpAnimformatRolloverFP1" fprolloverstyle="font-family: Tahoma; color: #4675BE; text-decoration: underline; font-size: 8pt; font-weight: bold" onmouseover="rollIn(this)" onmouseout="rollOut(this)" language="Javascript1.2">
    		<font color="#4675BE">Contact Us</font></a></b></td>
    		<td align="center">::</td>
    		<td align="center"><b>
    		<a href="Cat_home.Asp" style="text-decoration: none" dynamicanimation="fpAnimformatRolloverFP1" fprolloverstyle="font-family: Tahoma; color: #4675BE; text-decoration: underline; font-size: 8pt; font-weight: bold" onmouseover="rollIn(this)" onmouseout="rollOut(this)" language="Javascript1.2">
    		<font color="#4675BE">E - Catalogue</font></a></b></td>
    		<td align="center">::</td>
    		<td align="center"><b>
    		<a href="policy.Asp" style="text-decoration: none" dynamicanimation="fpAnimformatRolloverFP1" fprolloverstyle="font-family: Tahoma; color: #4675BE; text-decoration: underline; font-size: 8pt; font-weight: bold" onmouseover="rollIn(this)" onmouseout="rollOut(this)" language="Javascript1.2">
    		<font color="#4675BE">Policies</font></a></b></td>
    		<td align="center">::</td>
    		<td align="center"><b>
    		<a href="co_users.Asp" style="text-decoration: none" dynamicanimation="fpAnimformatRolloverFP1" fprolloverstyle="font-family: Tahoma; color: #4675BE; text-decoration: underline; font-size: 8pt; font-weight: bold" onmouseover="rollIn(this)" onmouseout="rollOut(this)" language="Javascript1.2">
    		<font color="#4675BE">Corporate Users</font></a></b></td>
    		<td align="center">::</td>
    		<td align="center"><b>
    		<a href="login.Asp" style="text-decoration: none" dynamicanimation="fpAnimformatRolloverFP1" fprolloverstyle="font-family: Tahoma; color: #4675BE; text-decoration: underline; font-size: 8pt; font-weight: bold" onmouseover="rollIn(this)" onmouseout="rollOut(this)" language="Javascript1.2">
    		<font color="#4675BE">Login</font></a></b></td>
    	</tr>
    	<tr>
    		<td colspan="13"><font size="1" color="#FF8A00">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font>
    		<span style="font-weight: 400"><font size="1" color="#4675BE">Copyright 
    		 2010 Bahamdoon Trading Est. All rights reserved.</font></span></td>
    	</tr>
    </table>
    		</td>
    	</tr>
    </table>
    		</TD>
    	</TR>
    	</TABLE>
    <!-- End ImageReady Slices -->
    <noscript><a href="images/css.html"><img src="images/spacer.gif" width="1" height="1" border="0"></a></noscript>
    </BODY>
    </HTML>
    Please help me i will be thankful to you coz my job is on risk... please....
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,453
    Rep Power
    4539
    You need to identify line 309

    If you have any 'on error resume next' statement in your db code remove it and see what errors show up.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester

IMN logo majestic logo threadwatch logo seochat tools logo