By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,556 Members | 1,033 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,556 IT Pros & Developers. It's quick & easy.

Getting type mismatch error '[string : " "]'

vikas251074
100+
P: 198
I am getting error above in following code since few days giving tension day and night.

How can I solve this? I am facing since Oct.25. in line no. 362

After doing a lot of homework, I am surrendered to you.


Expand|Select|Wrap|Line Numbers
  1. <%@ Language=VBScript%>
  2. <%Option Explicit%>
  3. <html>
  4. <head>
  5. <title>Barauni Refinery - Post Retirement Data Management </title>
  6. <!--#include file="font.css"-->
  7. <!--#include file="func.inc"-->
  8. <!--#include file="head.inc"-->
  9.  
  10. <script language="Javascript">
  11.  
  12. function main()
  13. {
  14.   window.location = "sabf_menu.asp"
  15. }
  16.  
  17. function capital(temp) {
  18.   alert(temp);
  19.   var str = temp.value;
  20.   document.getElementById(temp.id).value = str.toUpperCase();
  21. }
  22.  
  23. function cal1third() {
  24.   var amt = 1000;
  25.   var amt1 = amt/3;
  26.   document.getElementbyId('v1third').value = amt1;
  27. }
  28.  
  29. function confirmsubmit()
  30. {
  31.   var agree = confirm("Do you want to save this record?")
  32.   if (agree)
  33.     return true;
  34.   else
  35.     return false;
  36. }
  37.  
  38. </script>
  39.  
  40. </head>
  41.  
  42. <body>
  43.  
  44. <%
  45. Dim R
  46. Dim SQL 
  47. Dim vempno, vempname, vdesign, vsex, vgrade, vcategory, vdob, vdoj, vdos, vdojgr, vreason, voption, vcommutation
  48. Dim vrehabilitation, vBasic2003, vstag2003, vpersonalpay2003, vsplpay2003, vadhoc2003, vnpa2003, vda2003, vprotectpay2003
  49. Dim vbasic, vstag, vpersonalpay, vsplpay, vadhoc, vnpa, vda, vprotectpay,vbeneficiaryspouse, vdobos, valtnominee1
  50. Dim valtnominee2, valtnominee3, valtnominee4, valtnominee5, valtnominee6, vaddress, vcontact, vassesseno, vtotalamt, v1third
  51. Dim vrefund, vmonthlypension, vchoiceopt, vannuityno, vannuityamt
  52. Dim errorMsg
  53. Dim conn
  54. Dim i
  55. Dim vcount
  56. Dim vdobyyyy, vdobmm, vdobdd
  57. Dim vdojyyyy, vdojmm, vdojdd
  58. Dim vdosyyyy, vdosmm, vdosdd
  59. Dim vdojgryyyy, vdojgrmm, vdojgrdd
  60. Dim vdobosyyyy, vdobosmm, vdobosdd
  61. Dim no_of_day
  62.  
  63. Set conn = Server.Createobject("ADODB.Connection")
  64. conn.Open "DSN=ORA; User ID = scott; Password = tiger"
  65. Set R = Server.CreateObject("ADODB.Recordset")
  66.  
  67. 'CLEAR THE FORM VARIABLES
  68. %><!--#include file="clear_sabf_form_var.inc"--><%
  69.  
  70.   If Not IsEmpty(Request.Form("submit")) then
  71.     vempno = Request.Form("vempno")
  72.     vempname = Request.Form("vempname")
  73.     vdesign = Request.Form("vdesign")
  74.     vsex = Request.Form("vsex")
  75.     vgrade = Request.Form("vgrade")
  76.     vcategory = Request.Form("vcategory")
  77.     vdobyyyy = Request.Form("vdobyyyy")
  78.     vdobmm = Request.Form("vdobmm")
  79.     vdobdd = Request.Form("vdobdd")
  80.     vdojyyyy = Request.Form("vdojyyyy")
  81.     vdojmm = Request.Form("vdojmm")
  82.     vdojdd = Request.Form("vdojdd")
  83.     vdosyyyy = Request.Form("vdosyyyy")
  84.     vdosmm = Request.Form("vdosmm")
  85.     vdosdd = Request.Form("vdosdd")
  86.     vdojgryyyy = Request.Form("vdojgryyyy")
  87.     vdojgrmm = Request.Form("vdojgrmm")
  88.     vdojgrdd = Request.Form("vdojgrdd")
  89.     vdobosyyyy = Request.Form("vdobosyyyy")
  90.     vdobosmm = Request.Form("vdobosmm")
  91.     vdobosdd = Request.Form("vdobosdd")
  92.     vreason = Request.Form("vreason")
  93.     voption = Request.Form("voption")
  94.     vcommutation = Request.Form("vcommutation")
  95.     vrehabilitation = Request.Form("vrehabilitation")
  96.     vBasic2003 = Request.Form("vBasic2003")
  97.     vstag2003 = Request.Form("vstag2003")
  98.     vpersonalpay2003 = Request.Form("vpersonalpay2003")
  99.     vsplpay2003 = Request.Form("vsplpay2003")
  100.     vadhoc2003 = Request.Form("vadhoc2003")
  101.     vnpa2003 = Request.Form("vnpa2003")
  102.     vda2003 = Request.Form("vda2003")
  103.     vprotectpay2003 = Request.Form("vprotectpay2003")
  104.     vBasic = Request.Form("vBasic")
  105.     vstag = Request.Form("vstag")
  106.     vpersonalpay = Request.Form("vpersonalpay")
  107.     vsplpay = Request.Form("vsplpay")
  108.     vadhoc = Request.Form("vadhoc")
  109.     vnpa = Request.Form("vnpa")
  110.     vda = Request.Form("vda")
  111.     vprotectpay = Request.Form("vprotectpay")
  112.     vbeneficiaryspouse = Request.Form("vbeneficiaryspouse")
  113.     valtnominee1 = Request.Form("valtnominee1")
  114.     valtnominee2 = Request.Form("valtnominee2")
  115.     valtnominee3 = Request.Form("valtnominee3")
  116.     valtnominee4 = Request.Form("valtnominee4")
  117.     valtnominee5 = Request.Form("valtnominee5")
  118.     valtnominee6 = Request.Form("valtnominee6")
  119.     vaddress = Request.Form("vaddress")
  120.     vcontact = Request.Form("vcontact")
  121.     vassesseno = Request.Form("vassesseno")
  122.     vannuityno = Request.Form("vannuityno")
  123.     vannuityamt = Request.Form("vannuityamt")
  124.     v1third = Request.Form("v1third")
  125.     vrefund = Request.Form("vrefund")
  126.     vmonthlypension = Request.Form("vmonthlypension")
  127.     vchoiceopt = Request.Form("vchoiceopt")
  128.  
  129.     If len(vempno) = 0 then
  130.       errorMsg = "You must enter employee number."
  131.     Else
  132.       R.Open "SELECT count(empno) vcount FROM sabf WHERE empno = " & vempno, conn
  133.       If Cint(R("vcount")) > 0 Then
  134.         errorMsg = "Employee already exist"
  135.       End If
  136.       R.Close
  137.     End If
  138.     If len(errorMsg) = 0 Then
  139.       If len(vempname) = 0 Then
  140.         errorMsg = "Your must enter employee name."
  141.       Elseif len(vempname) > 50 Then
  142.         errorMsg = "The employee name > 50 characters. Please reduce the size."
  143.       Else
  144.         For i = 1 to len(vempname)
  145.           If instr(1, "abcdefghijklmnopqrstuvwxyz ", mid(vempname, i, 1), vbTextCompare) = 0 then
  146.             errorMsg = "The employee name is invalid. Please re-enter this field."
  147.             Exit For
  148.           End If
  149.         Next
  150.       End If
  151.     End If
  152.     If len(errorMsg) = 0 Then
  153.       If len(vdesign) = 0 Then
  154.         errorMsg = "Your must enter designation."
  155.       Elseif len(vdesign) > 20 Then
  156.         errorMsg = "The employee designation > 20 characters. Please reduce the size."
  157.       Else
  158.         For i = 1 to len(vdesign)
  159.           If instr(1, "_/()[]{}abcdefghijklmnopqrstuvwxyz0123456789 ", mid(vdesign, i, 1), vbTextCompare) = 0 then
  160.             errorMsg = "The employee designaton is invalid. Please re-enter this field."
  161.             Exit For
  162.           End If
  163.         Next
  164.       End If
  165.     End If
  166.     If len(errorMsg) = 0 Then
  167.       If len(vgrade) = 0 Then
  168.         errorMsg = "Your must enter grade of employee."
  169.       Elseif len(vgrade) > 10 Then
  170.         errorMsg = "The grade of employee > 10 characters. Please reduce the size."
  171.       Else
  172.         For i = 1 to len(vgrade)
  173.           If instr(1, "_/()[]{}IVABCDEFGHI12345678 ", mid(vgrade, i, 1), vbTextCompare) = 0 then
  174.             errorMsg = "The grade of employee is invalid. Please re-enter this field."
  175.             Exit For
  176.           End If
  177.         Next
  178.       End If
  179.     End If
  180.     If len(errorMsg) = 0 Then
  181.       If len(vaddress) = 0 Then
  182.         errorMsg = "Your must enter present address of employee."
  183.       Elseif len(vaddress) > 100 Then
  184.         errorMsg = "The address you entered is > 100 characters. Please reduce the size."
  185.       Else
  186.         For i = 1 to len(vaddress)
  187.           If instr(1, ",-s_/()[]{}ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ", mid(vaddress, i, 1), vbTextCompare) = 0 then
  188.             errorMsg = "The address you entered is invalid. Please re-enter address."
  189.             Exit For
  190.           End If
  191.         Next
  192.       End If
  193.     End If
  194.     If len(errorMsg) = 0 Then
  195.       If len(vassesseno) = 0 Then
  196.         errorMsg = "Your must enter assesse no. of employee."
  197.       Elseif len(vassesseno) > 50 Then
  198.         errorMsg = "The assesse no you entered is > 50 characters. Please reduce the size."
  199.       Else
  200.         For i = 1 to len(vassesseno)
  201.           If instr(1, "_/()[]{}abcdefghijklmnopqrstuvwxyz0123456789 ", mid(vassesseno, i, 1), vbTextCompare) = 0 then
  202.             errorMsg = "The assesse no you entered is invalid. Please re-enter assesse no."
  203.             Exit For
  204.           End If
  205.         Next
  206.       End If
  207.     End If
  208.     If len(errorMsg) = 0 Then
  209.       If len(vcontact) = 0 Then
  210.         errorMsg = "Your must enter contact no. of employee."
  211.       Elseif len(vcontact) > 10 Then
  212.         errorMsg = "The contact no. you entered is > 10 characters. Please reduce the size."
  213.       Else
  214.         For i = 1 to len(vcontact)
  215.           If instr(1, "_/()[]{}abcdefghijklmnopqrstuvwxyz0123456789 ", mid(vcontact, i, 1), vbTextCompare) = 0 then
  216.             errorMsg = "The contact no. you entered is invalid. Please re-enter contact no."
  217.             Exit For
  218.           End If
  219.         Next
  220.       End If
  221.     End If
  222.     If len(errorMsg) = 0 Then
  223.       R.Open "Select * from SABF", conn, 2, 3
  224.       R.Addnew
  225.       R("empno") = vempno
  226.       R("empname") = vempname
  227.       R("design") = vdesign
  228.       R("sex") = vsex
  229.       R("grade") = vgrade
  230.       R("category") = vcategory
  231.       R("dob") = Cdate(vdobmm & "/" & vdobdd & "/" & vdobyyyy)
  232.       R("doj") = Cdate(vdojmm & "/" & vdojdd & "/" & vdojyyyy)
  233.       R("dos") = Cdate(vdosmm & "/" & vdosdd & "/" & vdosyyyy)
  234.       R("dojgr") = Cdate(vdojgrmm & "/" & vdojgrdd & "/" & vdojgryyyy)
  235.       R("reason") = vreason
  236.       R("option1") = voption
  237.       R("commutation") = vcommutation
  238.       R("rehabilitation") = vrehabilitation
  239.       R("basic2003") = vbasic2003
  240.       R("stag2003") = vstag2003
  241.       R("personalpay2003") = vpersonalpay2003
  242.       R("splpay2003") = vsplpay2003
  243.       R("adhoc2003") = vadhoc2003
  244.       R("npa2003") = vnpa2003
  245.       R("da2003") = vda2003
  246.       R("protectpay2003") = vprotectpay2003
  247.       R("basic") = vbasic
  248.       R("stag") = vstag
  249.       R("personalpay") = vpersonalpay
  250.       R("splpay") = vsplpay
  251.       R("adhoc") = vadhoc
  252.       R("npa") = vnpa
  253.       R("da") = vda
  254.       R("protectpay") = vprotectpay
  255.       R("beneficiaryspouse") = vbeneficiaryspouse
  256.       R("dobos") = Cdate(vdobosmm & "/" & vdobosdd & "/" & vdobosyyyy)
  257.       R("altnominee1") = valtnominee1
  258.       R("altnominee2") = valtnominee2
  259.       R("altnominee3") = valtnominee3
  260.       R("altnominee4") = valtnominee4
  261.       R("altnominee5") = valtnominee5
  262.       R("altnominee6") = valtnominee6
  263.       R("address") = vaddress
  264.       R("contact") = vcontact
  265.       R("assesseno") = vassesseno
  266.       R("annuityno") = vannuityno
  267.       R("annuityamt") = vannuityamt
  268.       R("onethird") = v1third
  269.       R("refund") = vrefund
  270.       R("monthlypension") = vmonthlypension
  271.       R("choiceopt") = vchoiceopt
  272.       R.UPdate
  273.       R.Close%>
  274. 'CLEAR THE FORM VARIABLES
  275.       <!--#include file="clear_sabf_form_var.inc"--><%
  276.  
  277.     End If
  278.   End If
  279. '250
  280. %>
  281.   <div style="Position:Absolute; top:120; left:50; background-color: #f0f0f0">
  282.     <form method="POST" id="myform" name="myform" action="newsabf.asp">
  283. <%
  284.       If len(errorMsg) > 0 Then
  285.         Response.Write "<p><font color='red'>" & errorMsg & "</font></p>"
  286.       End If
  287. %>
  288.       <table width=900>
  289.         <tr>
  290.           <table align="center">
  291.             <tr>
  292.               <td align="center"><font face="arial"><h3>New SABF Entry</h3></font></h3>
  293.             </tr>
  294.  
  295.           </table>
  296.         </tr>
  297.     <hr><br>
  298.         <tr>
  299.           <table align="center">
  300.             <tr>
  301.               <td align="right"><font face="arial" size=2>Employee No : </font></td>
  302.               <td align='left'><input type="text" style="width:100px" name="vempno" value="<%=vempno%>"></td>
  303.               <td align="right"><font face="arial" size=2>Employee Name : </font></td>
  304.               <td align='left'><input type="text" style="width:300px" name="vempname" value="<%=vempname%>"></td>
  305.             </tr>
  306.             <tr>
  307.               <td align="right"><font face="arial" size=2>Designation : </font></td>
  308.               <td align='left'><input type="text" style="width:200px" name="vdesign" value="<%=vdesign%>"/></td>
  309.               <td align="right"><font face="arial" size=2>Sex : </font></td>
  310.               <td align='left'>
  311.                 <select name="vsex" value="<%=vsex%>">
  312.                   <option value="" selected>Select</option>
  313.                   <option value="M">Male</option>
  314.                   <option value="F">Female</option>
  315.                 </select>
  316.               </td>
  317.             </tr>
  318.             <tr>
  319.               <td align="right"><font face="arial" size=2>Grade : </font></td>
  320.               <td align='left'>
  321.                 <select name="vgrade" value="<%=vgrade%>">
  322.                   <option value="" selected>Select</option>
  323.                   <%SQL = "SELECT grade FROM grademst ORDER BY grade"
  324.                     R.Open SQL, conn
  325.                     do until R.eof %>
  326.                       <option value="<%=R("grade")%>"><%=R("grade")%></option>
  327.                       <% R.Movenext
  328.                     loop
  329.                   R.Close%>
  330.                 </select>
  331.               </td>
  332.               <td align="right"><font face="arial" size=2>Category : </font></td>
  333.               <td align="left">
  334.                  <font face="arial" size=2><select name="vcategory" value="<%=vcategory%>">
  335.                        <option value=" ">Select</option>
  336.                        <option value="O">Officer</option>
  337.                        <option value="S">Staff</option></select>
  338.                  </font>
  339.               </td>
  340.             </tr>
  341.             <tr>
  342.               <td align="right"><font face="arial" size=2>Date of Birth : </font></td>
  343.               <td>
  344.                 <select name="vdobyyyy" value="<%=vdobyyyy%>">
  345.                   <option value="0">Select</option>
  346.                   <%i=1947
  347.                   do while i <= Cint(year(date())) - 18%>
  348.                         <option value="<%=i%>"><%=i%></option>
  349.                     <%i = i + 1
  350.                   loop%>
  351.                 </select>
  352.                 <select name="vdobmm" value="<%=vdobmm%>">
  353.                   <option value="0"></option>
  354.                   <%i=1
  355.                   Do while i <= 12%>
  356.                       <option value="<%=i%>"><%=i%></option>
  357.                     <%i = i + 1
  358.                   loop%>
  359.                 </select>
  360.                 <select name="vdobdd" value="<%=vdobdd%>">
  361.                   <option value="0"></option>
  362.                   <%If vdobyyyy mod 4 = 0 And vdobmm = 2 Then
  363.                     no_of_day = 29
  364.                   ElseIf vdobyyyy mod 4 <> 0 and vdobmm = 2 Then
  365.                     no_of_day = 28
  366.                   ElseIf vdobmm=4 or vdobmm=6 or vdobmm=9 or vdobmm=11 Then
  367.                     no_of_day = 30
  368.                   Else
  369.                     no_of_day = 31
  370.                   End If
  371.                   i=1
  372.                   Do while i <= no_of_day%>
  373.                       <option value="<%=i%>"><%=i%></option>
  374.                     <%i = i + 1
  375.                   loop%>
  376.                 </select>
  377.               </td>
  378.               <td align="right"><font face="arial" size=2>Date of Join : </font></td>
  379.               <td>
  380.                 <select name="vdojyyyy" value="<%=vdojyyyy%>">
  381.                   <option value=" ">Select</option>
  382.                   <%i=1965
  383.                   do while i <= year(date())%>
  384.                         <option value="<%=i%>"><%=i%></option>
  385.                       <%i = i + 1
  386.                   loop%>
  387.                 </select>
  388.                 <select name="vdojmm" value="<%=vdojmm%>">
  389.                   <option value=" "></option>
  390.                   <%i=1
  391.                   Do while i <= 12%>
  392.                       <option value="<%=i%>"><%=i%></option>
  393.                     <%i = i + 1
  394.                   loop%>
  395.                 </select>
  396.                 <select name="vdojdd" value="<%=vdojdd%>">
  397.                   <option value=" "></option>
  398.                   <%If vdojyyyy mod 4 = 0 And vdojmm = 2 Then
  399.                     no_of_day = 29
  400.                   ElseIf vdojyyyy mod 4 <> 0 and vdojmm = 2 Then
  401.                     no_of_day = 28
  402.                   ElseIf vdojmm=4 or vdojmm=6 or vdojmm=9 or vdojmm=11 Then
  403.                     no_of_day = 30
  404.                   Else
  405.                     no_of_day = 31
  406.                   End If
  407.                   i=1
  408.                   Do while i <= no_of_day%>
  409.                       <option value="<%=i%>"><%=i%></option>
  410.                     <%i = i + 1
  411.                   loop%>
  412.                 </select>
  413.               </td>
  414.             </tr>
  415.             <tr>
  416.               <td align="right"><font face="arial" size=2>Date of Seperation : </font></td>
  417.               <td>
  418.                 <select name="vdosyyyy" value="<%=vdosyyyy%>">
  419.                   <option value=" ">Select</option>
  420.                   <%i=1965
  421.                   do while i <= year(date())%>
  422.                         <option value="<%=i%>"><%=i%></option>
  423.                       <%i = i + 1
  424.                   loop%>
  425.                 </select>
  426.                 <select name="vdosmm" value="<%=vdosmm%>">
  427.                   <option value=" "></option>
  428.                   <%i=1
  429.                   Do while i <= 12%>
  430.                       <option value="<%=i%>"><%=i%></option>
  431.                     <%i = i + 1
  432.                   loop%>
  433.                 </select>
  434.                 <select name="vdosdd" value="<%=vdosdd%>">
  435.                   <option value=" "></option>
  436.                   <%If vdosyyyy mod 4 = 0 And vdosmm = 2 Then
  437.                     no_of_day = 29
  438.                   ElseIf vdosyyyy mod 4 <> 0 and vdosmm = 2 Then
  439.                     no_of_day = 28
  440.                   ElseIf vdosmm=4 or vdosmm=6 or vdosmm=9 or vdosmm=11 Then
  441.                     no_of_day = 30
  442.                   Else
  443.                     no_of_day = 31
  444.                   End If
  445.                   i=1
  446.                   Do while i <= no_of_day%>
  447.                       <option value="<%=i%>"><%=i%></option>
  448.                     <%i = i + 1
  449.                   loop%>
  450.                 </select>
  451.               </td>
  452.               <td align="right"><font face="arial" size=2>Date of Join in Grade A : </font></td>
  453.               <td align='left'>
  454.                 <select name="vdojgryyyy" value="<%=vdojgryyyy%>">
  455.                   <option value=" ">Select</option>
  456.                   <%i=1965
  457.                   do while i <= year(date())%>
  458.                         <option value="<%=i%>"><%=i%></option>
  459.                       <%i = i + 1
  460.                   loop%>
  461.                 </select>
  462.                 <select name="vdojgrmm" value="<%=vdojgrmm%>">
  463.                   <option value=" "></option>
  464.                   <%i=1
  465.                   Do while i <= 12%>
  466.                       <option value="<%=i%>"><%=i%></option>
  467.                     <%i = i + 1
  468.                   loop%>
  469.                 </select>
  470.                 <select name="vdojgrdd" value="<%=vdojgrdd%>">
  471.                   <option value=" "></option>
  472.                   <%If vdojgryyyy mod 4 = 0 And vdojgrmm = 2 Then
  473.                     no_of_day = 29
  474.                   ElseIf vdojgryyyy mod 4 <> 0 and vdojgrmm = 2 Then
  475.                     no_of_day = 28
  476.                   ElseIf vdojgrmm=4 or vdojgrmm=6 or vdojgrmm=9 or vdojgrmm=11 Then
  477.                     no_of_day = 30
  478.                   Else
  479.                     no_of_day = 31
  480.                   End If
  481.                   i=1
  482.                   Do while i <= no_of_day%>
  483.                       <option value="<%=i%>"><%=i%></option>
  484.                     <%i = i + 1
  485.                   loop%>
  486.                 </select><font color='blue' size=2>(If so, in case of staff)</font>
  487.               </td>
  488.             </tr>
  489.  
  490.             <tr>
  491.               <td align="right"><font face="arial" size=2>Reason of Seperation</font></td>
  492.               <td align="left">
  493.                 <select name="vreason" value="<%=vreason%>">
  494.                   <option value=" ">Select</option>
  495.                   <option value="Death">Death</option>
  496.                   <option value="OVSS">OVSS</option>
  497.                   <option value="VRS">VRS</option>
  498.                   <option value="SUP">SUP</option>
  499.                 </select>
  500.               </td>
  501.               <td align="right"><font face="arial" size=2>Rehabilitation Option : </font></td>
  502.               <td align="left">
  503.                 <select name="vrehabilitation" value="<%=vrehabilitation%>">
  504.                   <option value=" ">Select</option>
  505.                   <option value="R1">R1</option>
  506.                   <option value="R2">R2</option>
  507.                   <option value="R3">R3</option>
  508.                 </select>
  509.               </td>
  510.             </tr>
  511.  
  512.  
  513.           </table>
  514.  
  515.         </tr>
  516.  
  517.         <table align="center"><tr>
  518.               <td align="right"><font face="arial" size=2>Option opted : </font></td>
  519.               <td align='left'>
  520.                 <select name="voption" value="<%=voption%>">
  521.                   <option value=" ">Select</option>
  522.                   <%R.Open "SELECT code, description FROM optionopted", conn
  523.                     do until R.eof %>
  524.                       <option value="<%=R("code")%>"><%=R("description")%></option>
  525.                       <%R.Movenext
  526.                     loop
  527.                     R.Close%>
  528.                 </select>
  529.               </td>
  530.         </tr></table>
  531.  
  532.  
  533.         <tr>
  534.       <table align="center" border=1><tr>
  535.            <td align="center"><font face="arial" size=2>As on 2003</font>
  536.              <table>
  537.                <tr>
  538.                  <td align="right"><font face="arial" size=2>Basic Salary : </font></td>
  539.                  <td align='left'><input type="text" style="width:200px" name="vbasic2003" value="<%=vbasic2003%>"></td>
  540.                </tr>
  541.                <tr>
  542.                  <td align="right"><font face="arial" size=2>Stagnation Increment : </font></td>
  543.                  <td align='left'><input type="text" style="width:200px" name="vstag2003" value="<%=vstag2003%>"></td>
  544.                </tr>
  545.                <tr>
  546.                  <td align="right"><font face="arial" size=2>Personal Pay : </font></td>
  547.                  <td align='left'><input type="text" style="width:200px" name="vpersonalpay2003" value="<%=vpersonalpay2003%>"></td>
  548.                </tr>
  549.                <tr>
  550.                  <td align="right"><font face="arial" size=2>Special Pay : </font></td>
  551.                  <td align='left'><input type="text" style="width:200px" name="vsplpay2003" value="<%=vsplpay2003%>"></td>
  552.                </tr>
  553.                <tr>
  554.                  <td align="right"><font face="arial" size=2>Adhoc Pay : </font></td>
  555.                  <td align='left'><input type="text" style="width:200px" name="vadhoc2003" value="<%=vadhoc2003%>"></td>
  556.                </tr>
  557.                <tr>
  558.                  <td align="right"><font face="arial" size=2>NPA : </font></td>
  559.                  <td align='left'><input type="text" style="width:200px" name="vnpa2003" value="<%=vnpa2003%>"></td>
  560.                </tr>
  561.                <tr>
  562.                  <td align="right"><font face="arial" size=2>DA : </font></td>
  563.                  <td align='left'><input type="text" style="width:200px" name="vda2003" value="<%=vda2003%>"></td>
  564.                </tr>
  565.                <tr>
  566.                  <td align="right"><font face="arial" size=2>Protected Pay : </font></td>
  567.                  <td align='left'><input type="text" style="width:200px" name="vprotectpay2003" value="<%=vprotectpay2003%>"></td>
  568.                </tr>
  569.              </table>
  570.            </td>
  571.            <td align="center"><font face="arial" size=2>As on Superannuation</font>
  572.              <table>
  573.                <tr>
  574.                  <td align="right"><font face="arial" size=2>Basic Salary : </font></td>
  575.                  <td align='left'><input type="text" style="width:200px" name="vbasic" value="<%=vbasic%>"></td>
  576.                </tr>
  577.                <tr>
  578.                  <td align="right"><font face="arial" size=2>Stagnation Increment : </font></td>
  579.                  <td align='left'><input type="text" style="width:200px" name="vstag" value="<%=vstag%>"></td>
  580.                </tr>
  581.                <tr>
  582.                  <td align="right"><font face="arial" size=2>Personal Pay : </font></td>
  583.                  <td align='left'><input type="text" style="width:200px" name="vpersonalpay" value="<%=vpersonalpay%>"></td>
  584.                </tr>
  585.                <tr>
  586.                  <td align="right"><font face="arial" size=2>Special Pay : </font></td>
  587.                  <td align='left'><input type="text" style="width:200px" name="vsplpay" value="<%=vsplpay%>"></td>
  588.                </tr>
  589.                <tr>
  590.                  <td align="right"><font face="arial" size=2>Adhoc Pay : </font></td>
  591.                  <td align='left'><input type="text" style="width:200px" name="vadhoc" value="<%=vadhoc%>"></td>
  592.                </tr>
  593.                <tr>
  594.                  <td align="right"><font face="arial" size=2>NPA : </font></td>
  595.                  <td align='left'><input type="text" style="width:200px" name="vnpa" value="<%=vnpa%>"></td>
  596.                </tr>
  597.                <tr>
  598.                  <td align="right"><font face="arial" size=2>DA : </font></td>
  599.                  <td align='left'><input type="text" style="width:200px" name="vda" value="<%=vda%>"></td>
  600.                </tr>
  601.                <tr>
  602.                  <td align="right"><font face="arial" size=2>Protected Pay : </font></td>
  603.                  <td align='left'><input type="text" style="width:200px" name="vprotectpay" value="<%=vprotectpay%>"></td>
  604.                </tr>
  605.              </table>
  606.            </td>
  607.         </table></tr>
  608.         <table><tr>
  609.           <td align="right"><font face="arial" size=2>Name of Beneficiary(Spouse) : </font></td>
  610.           <td align="left"><input type="text" style="width:200px" name="vbeneficiaryspouse" value="<%=vbeneficiaryspouse%>"></td>
  611.               <td align="right"><font face="arial" size=2>Date of Birth of Spouse : </font></td>
  612.               <td>
  613.                 <select name="vdobosyyyy" value="<%=vdobosyyyy%>">
  614.                   <option value=" ">Select</option>
  615.                   <%i=1965
  616.                   do while i <= year(date())%>
  617.                         <option value="<%=i%>"><%=i%></option>
  618.                     <%i = i + 1
  619.                   loop%>
  620.                 </select>
  621.                 <select name="vdobosmm" value="<%=vdobosmm%>">
  622.                   <option value=" "></option>
  623.                   <%i=1
  624.                   Do while i <= 12%>
  625.                       <option value="<%=i%>"><%=i%></option>
  626.                     <%i = i + 1
  627.                   loop%>
  628.                 </select>
  629.                 <select name="vdobosdd" value="<%=vdobosdd%>">
  630.                   <option value=" "></option>
  631.                   <%If vdobosyyyy mod 4 = 0 And vdobosmm = 2 Then
  632.                     no_of_day = 29
  633.                   ElseIf vdobosyyyy mod 4 <> 0 and vdobosmm = 2 Then
  634.                     no_of_day = 28
  635.                   ElseIf vdobosmm=4 or vdobosmm=6 or vdobosmm=9 or vdobosmm=11 Then
  636.                     no_of_day = 30
  637.                   Else
  638.                     no_of_day = 31
  639.                   End If
  640.                   i=1
  641.                   Do while i <= no_of_day%>
  642.                       <option value="<%=i%>"><%=i%></option>
  643.                     <%i = i + 1
  644.                   loop%>
  645.                 </select>
  646.               </td>
  647.         </tr>
  648.         <tr>
  649.           <td align="right"><font face="arial" size=2>Alternate Nominee(1) : </font></td>
  650.           <td align="left"><input type="text" style="width:200px" name="valtnominee1" value="<%=valtnominee1%>"></td>
  651.           <td align="right"><font face="arial" size=2>Alternate Nominee(2) : </font></td>
  652.           <td align="left"><input type="text" style="width:200px" name="valtnominee2" value="<%=valtnominee2%>"></td>
  653.         </tr>
  654.         <tr>
  655.           <td align="right"><font face="arial" size=2>Alternate Nominee(3) : </font></td>
  656.           <td align="left"><input type="text" style="width:200px" name="valtnominee3" value="<%=valtnominee3%>"></td>
  657.           <td align="right"><font face="arial" size=2>Alternate Nominee(4) : </font></td>
  658.           <td align="left"><input type="text" style="width:200px" name="valtnominee4" value="<%=valtnominee4%>"></td>
  659.         </tr>
  660.         <tr>
  661.           <td align="right"><font face="arial" size=2>Alternate Nominee(5) : </font></td>
  662.           <td align="left"><input type="text" style="width:200px" name="valtnominee5" value="<%=valtnominee5%>"></td>
  663.           <td align="right"><font face="arial" size=2>Alternate Nominee(6) : </font></td>
  664.           <td align="left"><input type="text" style="width:200px" name="valtnominee6" value="<%=valtnominee6%>"></td>
  665.         </tr></table>
  666.  
  667.         <table align="center"><tr>
  668.           <td align="right"><font face="arial" size=2>Address : </font></td>
  669.           <td align="left"><input type="text" style="width:700px" name="vaddress" value="<%=vaddress%>"></td>
  670.         </tr></table>
  671.  
  672.         <table align="center">
  673.           <tr>
  674.             <td align="right"><font face="arial" size=2>Contact No : </font></td>
  675.             <td align="left"><input type="text" style="width:100px" name="vcontact" value="<%=vcontact%>"></td>
  676.               <td align="right"><font face="arial" size=2>1/3 Commutation : </font></td>
  677.               <td align="left">
  678.                 <select name="vcommutation" value="<%=vcommutation%>">
  679.                   <option value=" ">Select</option>
  680.                   <option value="Y">Yes</option>
  681.                   <option value="N">No</option>
  682.                 </select>
  683.               </td>
  684.           </tr>
  685.           <tr>
  686.             <td align="right"><font face="arial" size=2>Assess No : </font></td>
  687.             <td align="left"><input type="text" style="width:150px" name="vassesseno" value="<%=vassesseno%>"></td>
  688.             <td align="right"><font face="arial" size=2>Annuity No : </font></td>
  689.             <td align="left"><input type="text" style="width:150px" name="vannuityno" value="<%=vannuityno%>"></td>
  690.           </tr>
  691.           <tr>
  692.             <td align="right"><font face="arial" size=2>Annuity Amount : </font></td>
  693.             <td align="left"><input type="text" style="width:150px" name="vannuityamt" value="<%=vannuityamt%>" id="vannuityamt"/></td>
  694.             <td align="right"><font face="arial" size=2>One Third Commutation : </font></td>
  695.             <td align="left"><input type="text" style="width:150px" name="v1third" value="<%=v1third%>" id="v1third"></td>
  696.           </tr>
  697.           <tr>
  698.             <td align="right"><font face="arial" size=2>Purchase Price Annuity : </font></td>
  699.             <td align="left"><input type="text" style="width:150px" name="vrefund" value="<%=vrefund%>"></td>
  700.             <td align="right"><font face="arial" size=2>Uncommuted Monthly Pension : </font></td>
  701.             <td align="left"><input type="text" style="width:150px" name="vmonthlypension" value="<%=vmonthlypension%>"></td>
  702.           </tr>
  703.           <tr>
  704.             <td align="right"><font face="arial" size=2>Pension amount as per opted : </font></td>
  705.             <td align="left"><input type="text" style="width:150px" name="vchoiceopt" value="<%=vchoiceopt%>"></td>
  706.             <td></td><td></td>
  707.           </tr>
  708.         </table>
  709.  
  710.         <tr>
  711.           <table align="center">
  712.             <tr>
  713.               <td align="center"><input type="Submit" name="submit" value="Submit">
  714.                                  <input type="reset" name="reset" value="Reset">
  715.                                  <input type="reset" name="back" value="Back" onclick="main()"/>  
  716.               </td>
  717.             </tr>
  718.           </table>
  719.         </tr>
  720.       </table>
  721.     </form>
  722.     </p>
  723.   </div>
  724. </body>
  725. </html>
  726.  
Oct 27 '09 #1
Share this Question
Share on Google+
7 Replies

jhardman
Expert 2.5K+
P: 3,405
Could you confirm the line number? Are you getting the error on the following line?
Expand|Select|Wrap|Line Numbers
  1. <%If vdobyyyy mod 4 = 0 And vdobmm = 2 Then
If so, please try the following just to make sure it works
Expand|Select|Wrap|Line Numbers
  1. <%dim vdobyyyy_alt
  2. vdobyyyy_alt = 1976
  3. If vdobyyyy_alt mod 4 = 0 And vdobmm = 2 Then
If that works, then I think I know what the problem is.

Jared
Oct 27 '09 #2

vikas251074
100+
P: 198
Yes the problem lies in line no. 362

But this may not be the solution as value may change everytime.

I have already tried this way.
Oct 28 '09 #3

jhardman
Expert 2.5K+
P: 3,405
I wanted you to try that to narrow down the problem, not because I thought that was a good solution. The problem is that dobyyyy doesn't necessarily contain an integer year. Try to
Expand|Select|Wrap|Line Numbers
  1. response.write "<!-- year is " & dobyyyy & "-->" & vbnewline
, if the year looks right but still gives you the error, then you probably have dobyyyy saved as a string. You can solve this when you assign the variable by doing
Expand|Select|Wrap|Line Numbers
  1. dobyyyy = cint(expression that generates the variable now)
If the year doesn't write out correctly, then you are not forming the year correctly.

Jared
Oct 28 '09 #4

vikas251074
100+
P: 198
All the problem lies in between line no. 342 and 377 where scripting for date of birth is written. This code is again displaed in this reply.

In the below code of scripting of date of birth, line no. 4 vdobyyyy assigns 0 value by default if nothing is selected so that it may not give error while saving records in oracle. Is this process wrong?

No other places is where vdobyyyy is assigned value. but the value of vdobyyyy is initialize two times in line no. 68 and 275 in the full code given in first thread which is called through <include> tag. the details of include tag is given below this code.

Expand|Select|Wrap|Line Numbers
  1.               <td align="right"><font face="arial" size=2>Date of Birth : </font></td> 
  2.               <td> 
  3.                 <select name="vdobyyyy" value="<%=vdobyyyy%>"> 
  4.                   <option value="0">Select</option> 
  5.                   <%i=1947 
  6.                   do while i <= Cint(year(date())) - 18%> 
  7.                         <option value="<%=i%>"><%=i%></option> 
  8.                     <%i = i + 1 
  9.                   loop%> 
  10.                 </select> 
  11.                 <select name="vdobmm" value="<%=vdobmm%>"> 
  12.                   <option value="0"></option> 
  13.                   <%i=1 
  14.                   Do while i <= 12%> 
  15.                       <option value="<%=i%>"><%=i%></option> 
  16.                     <%i = i + 1 
  17.                   loop%> 
  18.                 </select> 
  19.                 <select name="vdobdd" value="<%=vdobdd%>"> 
  20.                   <option value="0"></option> 
  21.                   <%If vdobyyyy mod 4 = 0 And vdobmm = 2 Then 
  22.                     no_of_day = 29 
  23.                   ElseIf vdobyyyy mod 4 <> 0 and vdobmm = 2 Then 
  24.                     no_of_day = 28 
  25.                   ElseIf vdobmm=4 or vdobmm=6 or vdobmm=9 or vdobmm=11 Then 
  26.                     no_of_day = 30 
  27.                   Else 
  28.                     no_of_day = 31 
  29.                   End If 
  30.                   i=1 
  31.                   Do while i <= no_of_day%> 
  32.                       <option value="<%=i%>"><%=i%></option> 
  33.                     <%i = i + 1 
  34.                   loop%> 
  35.                 </select> 
  36.               </td> 
  37.  


Code of 'clear_sabf_form_var.inc'
Expand|Select|Wrap|Line Numbers
  1. 'CLEAR THE FORM VARIABLES
  2. <%
  3.     vempno = ""
  4.     vempname = ""
  5.     vdesign = ""
  6.     vsex = ""
  7.     vgrade = ""
  8.     vcategory = ""
  9.     vdobyyyy = "0"
  10.     vdobmm = "0"
  11.     vdobdd = "0"
  12.     vdojyyyy = "0"
  13.     vdojmm = "0"
  14.     vdojdd = "0"
  15.     vdosyyyy = "0"
  16.     vdosmm = "0"
  17.     vdosdd = "0"
  18.     vdojgryyyy = "0"
  19.     vdojgrmm = "0"
  20.     vdojgrdd = "0"
  21.     vdobosyyyy = "0"
  22.     vdobosmm = "0"
  23.     vdobosdd = "0"
  24.     vreason = ""
  25.     voption = ""
  26.     vcommutation = ""
  27.     vrehabilitation = ""
  28.     vBasic2003 = "0.00"
  29.     vstag2003 = "0.00"
  30.     vpersonalpay2003 = "0.00"
  31.     vsplpay2003 = "0.00"
  32.     vadhoc2003 = "0.00"
  33.     vnpa2003 = "0.00"
  34.     vda2003 = "0.00"
  35.     vprotectpay2003 = "0.00"
  36.     vBasic = "0.00"
  37.     vstag = "0.00"
  38.     vpersonalpay = "0.00"
  39.     vsplpay = "0.00"
  40.     vadhoc = "0.00"
  41.     vnpa = "0.00"
  42.     vda = "0.00"
  43.     vprotectpay = "0.00"
  44.     vbeneficiaryspouse = ""
  45.     valtnominee1 = ""
  46.     valtnominee2 = ""
  47.     valtnominee3 = ""
  48.     valtnominee4 = ""
  49.     valtnominee5 = ""
  50.     valtnominee6 = ""
  51.     vaddress = ""
  52.     vcontact = ""
  53.     vassesseno = ""
  54.     vannuityno = ""
  55.     vannuityamt = "0.00"
  56.     v1third = "0.00"
  57.     vrefund = "0.00"
  58.     vmonthlypension = "0.00"
  59.     vchoiceopt = "0.00"
  60. %>
  61.  
Oct 29 '09 #5

vikas251074
100+
P: 198
Sir

Here in this code where vdobyyyy is not assigned but only value is selected by selecting. So how can I cast the value to integer.
Nov 4 '09 #6

jhardman
Expert 2.5K+
P: 3,405
@vikas251074
you can cast a value to integer by using the cint() command. Example:
Expand|Select|Wrap|Line Numbers
  1. vdobyyyy = cint(request("vdobyyyy"))
but you are setting vdobyyyy = "0" in the include file, this makes it a string, not an integer. look at this example
Expand|Select|Wrap|Line Numbers
  1. vdobyyyy = 0 'this is an integer
  2. vdobyyyy = "0" 'this is a string
  3. vdobyyyy = cint("0") ' this is an integer
Does this make sense so far?

You are trying to do math against a string. If vdobyyyy is a string, and you say
Expand|Select|Wrap|Line Numbers
  1. <%If vdobyyyy mod 4 = 0 And vdobmm = 2 Then
then you will get an error - strings can't be evaluated by the 'mod' function, only numbers. If you want to keep vdobyyyy as a string, then you will need to do the math like this:
Expand|Select|Wrap|Line Numbers
  1. <%If cint(vdobyyyy) mod 4 = 0 And vdobmm = 2 Then
Do you see the difference? The other option is to keep only an integer in vdobyyyy.

Jared
Nov 5 '09 #7

vikas251074
100+
P: 198
Yes sir,

If I set the value of vdobyyyy in include file as follows :

vdobyyyy = 0

then the problem may be solved


Regards

Vikas
Nov 7 '09 #8

Post your reply

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