468,544 Members | 1,845 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,544 developers. It's quick & easy.

Type mismatch pointing to blank line?

I usually have no problem identifying a type mismatch error, but this one's got me pulling my hair out. The mismatch error is pointing to line 269, which is a blank line, and it's also within an if statement that shouldn't even be firing on the initial load. Here's my code. Thanks for any help! :D

Expand|Select|Wrap|Line Numbers
  1. <%
  2. dim conn
  3. dim rs
  4. dim strconn
  5. %>
  6.  
  7. <%if request("edit") = "" AND request("edit_exe") = "" AND request("delete") = "" AND request("delete_exe") = "" AND request("add_new") = "" AND request("add_new_exe") = "" then
  8.  
  9.     strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("..\MasterData.mdb")
  10.     set conn = server.createobject("adodb.connection")
  11.     conn.open strconn
  12.     set rs = server.createobject("adodb.recordset")
  13.     rs.open "select * from c1log order by mfg asc", conn, 2, 2
  14.     %>
  15.     <a href="default.asp?add_new=1">ADD NEW ENTRY</a><br><br>
  16.     <table border="0">
  17.  
  18.       <tr>
  19.         <td bgcolor="#CCCCFF"></td>
  20.         <td bgcolor="#CCCCFF"><font size="2"><b>MFG</b></font></td>
  21.         <td bgcolor="#CCCCFF"><font size="2"><b>Stock#</b></font></td>
  22.         <td bgcolor="#CCCCFF"><font size="2"><b>Invoice#</b></font></td>
  23.         <td bgcolor="#CCCCFF"></td>
  24.       </tr>
  25.  
  26.       <%do while not rs.eof%>
  27.       <tr>
  28.         <td><a href="default.asp?edit=<%=rs("id")%>"><font size="1">EDIT</font></a></td>
  29.         <td><font size="1"><%=rs("mfg")%></font></td>
  30.         <td><font size="1"><%=rs("StockNumber")%></font></td>
  31.         <td><font size="1"><%=rs("InvoiceNumber")%></font></td>
  32.         <td><a href="default.asp?delete=<%=rs("id")%>"><font size="1">DELETE</font></a></td>
  33.       </tr>
  34.       <%rs.movenext%>
  35.       <%loop
  36.       conn.close
  37.       set rs = nothing%>           
  38.     </table>
  39.  
  40. <%elseif request("add_new") <> "" then%>
  41.     <form method="post" action="default.asp?add_new_exe=1">
  42.     <table border="0" width="413">
  43.       <tr>
  44.         <td width="63"><font size="2"><b>MFG</b></font></td>
  45.         <td colspan="2"><!--webbot bot="Validation" b-value-required="TRUE" --><input size="7" name="mfg"></td>
  46.       </tr>                                
  47.       <tr>
  48.         <td width="63"><font size="2"><b>Stock#</b></font></td>
  49.         <td colspan="2"><!--webbot bot="Validation" b-value-required="TRUE" --><input size="26" name="StockNumber"></td>
  50.       </tr>
  51.       <tr>
  52.         <td width="63"><font size="2"><b>Invoice#</b></font></td>
  53.         <td colspan="2"><!--webbot bot="Validation" b-value-required="TRUE" --><input size="17" name="InvoiceNumber"></td>
  54.       </tr>
  55.       <tr>
  56.         <td width="63"><font size="2"><b>Account#</b></font></td>
  57.         <td colspan="2"><!--webbot bot="Validation" b-value-required="TRUE" --><input size="13" name="AccountNumber"></td>
  58.       </tr>
  59.       <tr>
  60.         <td width="63"><font size="2"><b>Dept#</b></font></td>
  61.         <td colspan="2"><input size="8" name="DeptNumber"></td>
  62.       </tr>
  63.       <tr>
  64.         <td valign="top" width="63"><font size="2"><b>Reason</b></font></td>
  65.         <td colspan="2"><!--webbot bot="Validation" b-value-required="TRUE" --><textarea name="reason" cols="40" rows="2"></textarea></td>
  66.       </tr>
  67.       <tr>
  68.         <td width="63"><font size="2"><b>SLMS#</b></font></td>
  69.         <td colspan="2">
  70.             <select name="SalesmanNumber">
  71.                 <%strconn2 = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("..\MasterData.mdb")
  72.                 set conn2 = server.createobject("adodb.connection")
  73.                 conn2.open strconn2
  74.                 set rs2 = server.createobject("adodb.recordset")%>
  75.                 <%rs2.open "select SalesmanNumber from Q_SalesmanNumber", conn2, 2, 2%>
  76.                 <%do while not rs2.eof%>
  77.                     <option value="<%=rs2("SalesmanNumber")%>"><%=rs2("SalesmanNumber")%></option>
  78.                 <%rs2.movenext
  79.                 loop
  80.                 conn2.close
  81.                 set rs2 = nothing%>
  82.             </select>        
  83.  
  84.         </td>
  85.       </tr>
  86.       <tr>
  87.         <td width="63"><font size="2"><b>Writer#</b></font></td>
  88.         <td colspan="2">
  89.  
  90.             <select name="WriterNumber">
  91.                 <%strconn2 = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("..\MasterData.mdb")
  92.                 set conn2 = server.createobject("adodb.connection")
  93.                 conn2.open strconn2
  94.                 set rs2 = server.createobject("adodb.recordset")%>
  95.                 <%rs2.open "select WriterNumber from Q_WriterNumber", conn2, 2, 2%>
  96.                 <%do while not rs2.eof%>
  97.                     <option value="<%=rs2("WriterNumber")%>"><%=rs2("WriterNumber")%></option>
  98.                 <%rs2.movenext
  99.                 loop
  100.                 conn2.close
  101.                 set rs2 = nothing%>
  102.             </select>
  103.  
  104.         </td>
  105.       </tr>
  106.       <tr>
  107.         <td width="63"><font size="2"><b>Sub?</b></font></td>
  108.         <td colspan="2"><font face="Tahoma">
  109.         <input type="radio" value="YES" name="Sub" style="font-weight: 700"><b><font size="2">YES&nbsp;&nbsp;
  110.         </font></b>
  111.         <input type="radio" checked name="Sub" value="NO" style="font-weight: 700"><b><font size="2">NO</font></b></font></td>
  112.       </tr>
  113.       <tr>
  114.         <td width="63">&nbsp;</td>
  115.         <td width="82"><font size="2" color="#C0C0C0"><b>Sub MFG</b></font></td>
  116.         <td width="254"><input size="8" name="SubMFG0"></td>
  117.       </tr>
  118.       <tr>
  119.         <td width="63">&nbsp;</td>
  120.         <td><font size="2" color="#C0C0C0"><b>Sub Stock#</b></font></td>
  121.         <td><input size="26" name="SubStockNumber0"></td>
  122.       </tr>
  123.       <tr>
  124.         <td colspan="3">&nbsp;</td>
  125.       </tr>
  126.       <tr><td colspan="3"><input type="submit" value="Submit">&nbsp;&nbsp;<a href="default.asp">CANCEL</a></td></tr>           
  127.     </table></form>                      
  128.     <%elseif request("add_new_exe") <> "" then%>
  129.         <%strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("..\MasterData.mdb")
  130.         set conn = server.createobject("adodb.connection")
  131.         conn.open strconn
  132.         set rs = server.createobject("adodb.recordset")
  133.         rs.open "c1log", conn, 2, 2
  134.         rs.addnew
  135.         rs("mfg") = request.form("mfg")
  136.         rs("StockNumber") = request.form("StockNumber")
  137.         rs("InvoceNumber") = request.form("InvoceNumber")
  138.         rs("AccountNumber") = request.form("AccountNumber")
  139.         rs("DeptNumber") = request.form("DeptNumber")
  140.         rs("reason") = request.form("reason")
  141.         rs("SalesmanNumber") = request.form("SalesmanNumber")
  142.         rs("WriterNumber") = request.form("WriterNumber")
  143.         rs("sub") = request.form("sub")
  144.         rs("SubMFG") = request.form("SubMFG")
  145.         rs("SubStockNumber") = request.form("SubStockNumber")
  146.         rs.update
  147.         conn.close        
  148.         set rs = nothing
  149.         response.redirect "default.asp"%>
  150.  
  151. <%elseif request("edit") <> "" then%>
  152.     <%strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("..\MasterData.mdb")
  153.     set conn = server.createobject("adodb.connection")
  154.     conn.open strconn
  155.     set rs = server.createobject("adodb.recordset")
  156.     rs.open "select * from c1log WHERE id = " & request("edit"), conn, 2, 2%>
  157.     <form method="post" action="default.asp?edit_exe=<%=request("edit")%>">
  158.     <table border="0" width="413">
  159.       <tr>
  160.         <td width="63"><font size="2"><b>Date</b></font></td>
  161.         <td colspan="2"><font size="2"><%=rs("DateEntered")%></font></td>
  162.       </tr>                                
  163.       <tr>
  164.         <td width="63"><font size="2"><b>MFG</b></font></td>
  165.         <td colspan="2"><input size="7" name="mfg" value="<%=rs("mfg")%>"></td>
  166.       </tr>                                
  167.       <tr>
  168.         <td width="63"><font size="2"><b>Stock#</b></font></td>
  169.         <td colspan="2"><input size="26" name="StockNumber" value="<%=rs("StockNumber")%>"></td>
  170.       </tr>
  171.       <tr>
  172.         <td width="63"><font size="2"><b>Invoice#</b></font></td>
  173.         <td colspan="2"><input size="17" name="InvoiceNumber" value="<%=rs("InvoiceNumber")%>"></td>
  174.       </tr>
  175.       <tr>
  176.         <td width="63"><font size="2"><b>Account#</b></font></td>
  177.         <td colspan="2"><input size="13" name="AccountNumber" value="<%=rs("AccountNumber")%>"></td>
  178.       </tr>
  179.       <tr>
  180.         <td width="63"><font size="2"><b>Dept#</b></font></td>
  181.         <td colspan="2"><input size="8" name="DeptNumber" value="<%=rs("DeptNumber")%>"></td>
  182.       </tr>
  183.       <tr>
  184.         <td valign="top" width="63"><font size="2"><b>Reason</b></font></td>
  185.         <td colspan="2"><textarea name="reason" cols="40" rows="2"><%=rs("reason")%></textarea></td>
  186.       </tr>
  187.       <tr>
  188.         <td width="63"><font size="2"><b>SLMS#</b></font></td>
  189.         <td colspan="2">
  190.             <select name="SalesmanNumber">
  191.                 <%strconn2 = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("..\MasterData.mdb")
  192.                 set conn2 = server.createobject("adodb.connection")
  193.                 conn2.open strconn2
  194.                 set rs2 = server.createobject("adodb.recordset")
  195.                 rs2.open "select SalesmanNumber from Q_SalesmanNumber", conn2, 2, 2
  196.                 do while not rs2.eof%>
  197.                     <option value="<%=rs2("SalesmanNumber")%>" <%if rs2("SalesmanNumber") = rs("SalesmanNumber") then%>selected<%end if%>><%=rs2("SalesmanNumber")%></option>
  198.                 <%rs2.movenext
  199.                 loop
  200.                 conn2.close
  201.                 set rs2 = nothing%>
  202.             </select>        
  203.  
  204.         </td>
  205.       </tr>
  206.       <tr>
  207.         <td width="63"><font size="2"><b>Writer#</b></font></td>
  208.         <td colspan="2">
  209.  
  210.             <select name="WriterNumber">
  211.                 <%strconn2 = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("..\MasterData.mdb")
  212.                 set conn2 = server.createobject("adodb.connection")
  213.                 conn2.open strconn2
  214.                 set rs2 = server.createobject("adodb.recordset")
  215.                 rs2.open "select WriterNumber from Q_WriterNumber", conn2, 2, 2
  216.                 do while not rs2.eof%>
  217.                     <option value="<%=rs2("WriterNumber")%>" <%if rs2("WriterNumber") = rs("WriterNumber") then%>selected<%end if%>><%=rs2("WriterNumber")%></option>
  218.                 <%rs2.movenext
  219.                 loop
  220.                 conn2.close
  221.                 set rs2 = nothing%>
  222.             </select>
  223.  
  224.         </td>
  225.       </tr>
  226.       <tr>
  227.         <td width="63"><font size="2"><b>Sub?</b></font></td>
  228.         <td colspan="2"><font face="Tahoma">
  229.         <input type="radio"<%if rs("sub") = "YES" then%> checked<%end if%> value="YES" name="Sub" style="font-weight: 700"><b><font size="2">YES&nbsp;&nbsp;
  230.         </font></b>
  231.         <input type="radio"<%if rs("sub") = "NO" then%> checked<%end if%> name="Sub" value="NO" style="font-weight: 700"><b><font size="2">NO</font></b></font></td>
  232.       </tr>
  233.       <tr>
  234.         <td width="63">&nbsp;</td>
  235.         <td width="82"><font size="2" color="#C0C0C0"><b>Sub MFG</b></font></td>
  236.         <td width="254"><input size="8" name="SubMFG" value="<%=rs("SubMFG")%>"></td>
  237.       </tr>
  238.       <tr>
  239.         <td width="63">&nbsp;</td>
  240.         <td width="82"><font size="2" color="#C0C0C0"><b>Sub Stock#</b></font></td>
  241.         <td width="254"><input size="26" name="SubStockNumber" value="<%=rs("SubStockNumber")%>"></td>
  242.       </tr>
  243.       <tr>
  244.         <td colspan="3">&nbsp;</td>
  245.       </tr>
  246.       <tr><td colspan="3"><input type="submit" value="Submit">&nbsp;&nbsp;<a href="default.asp">CANCEL</a></td></tr>           
  247.     </table></form>                      
  248.     <%elseif request("edit_exe") <> "" then%>
  249.         <%strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("..\MasterData.mdb")
  250.         set conn = server.createobject("adodb.connection")
  251.         conn.open strconn
  252.         set rs = server.createobject("adodb.recordset")
  253.         rs.open "select * from c1log WHERE id = " & request("edit_exe"), conn, 2, 2
  254.         rs("mfg") = request.form("mfg")
  255.         rs("StockNumber") = request.form("StockNumber")
  256.         rs("InvoceNumber") = request.form("InvoceNumber")
  257.         rs("AccountNumber") = request.form("AccountNumber")
  258.         rs("DeptNumber") = request.form("DeptNumber")
  259.         rs("reason") = request.form("reason")
  260.         rs("SalesmanNumber") = request.form("SalesmanNumber")
  261.         rs("WriterNumber") = request.form("WriterNumber")
  262.         rs("sub") = request.form("sub")
  263.         rs("SubMFG") = request.form("SubMFG")
  264.         rs("SubStockNumber") = request.form("SubStockNumber")
  265.         rs.update
  266.         conn.close
  267.         set rs = nothing
  268.         response.redirect "default.asp"
  269.  
  270. 'Type mismatch error is pointing to this line here
  271.  
  272. elseif request("delete") <> "" then%>
  273.     <%strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("..\MasterData.mdb")
  274.     set conn = server.createobject("adodb.connection")
  275.     conn.open strconn
  276.     set rs = server.createobject("adodb.recordset")
  277.     rs.open "select * from c1log WHERE id = " & request("delete"), conn, 2, 2%>
  278.       <br><font face="arial" size="2">
  279.       <b>Are you sure you want to delete <%=rs("mfg")%>-<%=rs("StockNumber")%> from the C1 log?</b></font><br><br>
  280.       <a href="default.asp?delete_exe=<%=request("delete")%>">YES</a>&nbsp;&nbsp;<a href="default.asp">CANCEL</a>
  281.       <%conn.close
  282.       set rs = nothing%><%elseif request("delete_exe") <> "" then%><%strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("..\MasterData.mdb")
  283.         set conn = server.createobject("adodb.connection")
  284.         conn.open strconn
  285.         set rs = server.createobject("adodb.recordset")
  286.         rs.open "select * from c1log WHERE id = " & request("delete_exe"), conn, 2, 2
  287.         rs.delete
  288.         rs.update
  289.         conn.close
  290.         set rs = nothing
  291.         response.redirect "default.asp"%><%end if%>
  292.  
Mar 16 '10 #1
1 2520
Doh, nevermind. I was using MS FrontPage validation on some of the fields and it was throwing everything all outta wack. Thanks anyways! :D
Mar 16 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by LJgrnl | last post: by
3 posts views Thread by Smriti Dev | last post: by
1 post views Thread by amitbadgi | last post: by
3 posts views Thread by amitbadgi | last post: by
1 post views Thread by Brett | last post: by
2 posts views Thread by acdevteam | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.