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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vikas251074
    New Member
    • Dec 2007
    • 198

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

    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.


    Code:
    <%@ Language=VBScript%>
    <%Option Explicit%>
    <html>
    <head>
    <title>Barauni Refinery - Post Retirement Data Management </title>
    <!--#include file="font.css"-->
    <!--#include file="func.inc"-->
    <!--#include file="head.inc"-->
    
    <script language="Javascript">
    
    function main()
    {
      window.location = "sabf_menu.asp"
    }
    
    function capital(temp) {
      alert(temp);
      var str = temp.value;
      document.getElementById(temp.id).value = str.toUpperCase();
    }
    
    function cal1third() {
      var amt = 1000;
      var amt1 = amt/3;
      document.getElementbyId('v1third').value = amt1;
    }
    
    function confirmsubmit()
    {
      var agree = confirm("Do you want to save this record?")
      if (agree)
        return true;
      else
        return false;
    }
    
    </script>
    
    </head>
    
    <body>
    
    <%
    Dim R
    Dim SQL 
    Dim vempno, vempname, vdesign, vsex, vgrade, vcategory, vdob, vdoj, vdos, vdojgr, vreason, voption, vcommutation
    Dim vrehabilitation, vBasic2003, vstag2003, vpersonalpay2003, vsplpay2003, vadhoc2003, vnpa2003, vda2003, vprotectpay2003
    Dim vbasic, vstag, vpersonalpay, vsplpay, vadhoc, vnpa, vda, vprotectpay,vbeneficiaryspouse, vdobos, valtnominee1
    Dim valtnominee2, valtnominee3, valtnominee4, valtnominee5, valtnominee6, vaddress, vcontact, vassesseno, vtotalamt, v1third
    Dim vrefund, vmonthlypension, vchoiceopt, vannuityno, vannuityamt
    Dim errorMsg
    Dim conn
    Dim i
    Dim vcount
    Dim vdobyyyy, vdobmm, vdobdd
    Dim vdojyyyy, vdojmm, vdojdd
    Dim vdosyyyy, vdosmm, vdosdd
    Dim vdojgryyyy, vdojgrmm, vdojgrdd
    Dim vdobosyyyy, vdobosmm, vdobosdd
    Dim no_of_day
    
    Set conn = Server.Createobject("ADODB.Connection")
    conn.Open "DSN=ORA; User ID = scott; Password = tiger"
    Set R = Server.CreateObject("ADODB.Recordset")
    
    'CLEAR THE FORM VARIABLES
    %><!--#include file="clear_sabf_form_var.inc"--><%
    
      If Not IsEmpty(Request.Form("submit")) then
        vempno = Request.Form("vempno")
        vempname = Request.Form("vempname")
        vdesign = Request.Form("vdesign")
        vsex = Request.Form("vsex")
        vgrade = Request.Form("vgrade")
        vcategory = Request.Form("vcategory")
        vdobyyyy = Request.Form("vdobyyyy")
        vdobmm = Request.Form("vdobmm")
        vdobdd = Request.Form("vdobdd")
        vdojyyyy = Request.Form("vdojyyyy")
        vdojmm = Request.Form("vdojmm")
        vdojdd = Request.Form("vdojdd")
        vdosyyyy = Request.Form("vdosyyyy")
        vdosmm = Request.Form("vdosmm")
        vdosdd = Request.Form("vdosdd")
        vdojgryyyy = Request.Form("vdojgryyyy")
        vdojgrmm = Request.Form("vdojgrmm")
        vdojgrdd = Request.Form("vdojgrdd")
        vdobosyyyy = Request.Form("vdobosyyyy")
        vdobosmm = Request.Form("vdobosmm")
        vdobosdd = Request.Form("vdobosdd")
        vreason = Request.Form("vreason")
        voption = Request.Form("voption")
        vcommutation = Request.Form("vcommutation")
        vrehabilitation = Request.Form("vrehabilitation")
        vBasic2003 = Request.Form("vBasic2003")
        vstag2003 = Request.Form("vstag2003")
        vpersonalpay2003 = Request.Form("vpersonalpay2003")
        vsplpay2003 = Request.Form("vsplpay2003")
        vadhoc2003 = Request.Form("vadhoc2003")
        vnpa2003 = Request.Form("vnpa2003")
        vda2003 = Request.Form("vda2003")
        vprotectpay2003 = Request.Form("vprotectpay2003")
        vBasic = Request.Form("vBasic")
        vstag = Request.Form("vstag")
        vpersonalpay = Request.Form("vpersonalpay")
        vsplpay = Request.Form("vsplpay")
        vadhoc = Request.Form("vadhoc")
        vnpa = Request.Form("vnpa")
        vda = Request.Form("vda")
        vprotectpay = Request.Form("vprotectpay")
        vbeneficiaryspouse = Request.Form("vbeneficiaryspouse")
        valtnominee1 = Request.Form("valtnominee1")
        valtnominee2 = Request.Form("valtnominee2")
        valtnominee3 = Request.Form("valtnominee3")
        valtnominee4 = Request.Form("valtnominee4")
        valtnominee5 = Request.Form("valtnominee5")
        valtnominee6 = Request.Form("valtnominee6")
        vaddress = Request.Form("vaddress")
        vcontact = Request.Form("vcontact")
        vassesseno = Request.Form("vassesseno")
        vannuityno = Request.Form("vannuityno")
        vannuityamt = Request.Form("vannuityamt")
        v1third = Request.Form("v1third")
        vrefund = Request.Form("vrefund")
        vmonthlypension = Request.Form("vmonthlypension")
        vchoiceopt = Request.Form("vchoiceopt")
        
        If len(vempno) = 0 then
          errorMsg = "You must enter employee number."
        Else
          R.Open "SELECT count(empno) vcount FROM sabf WHERE empno = " & vempno, conn
          If Cint(R("vcount")) > 0 Then
            errorMsg = "Employee already exist"
          End If
          R.Close
        End If
        If len(errorMsg) = 0 Then
          If len(vempname) = 0 Then
            errorMsg = "Your must enter employee name."
          Elseif len(vempname) > 50 Then
            errorMsg = "The employee name > 50 characters. Please reduce the size."
          Else
            For i = 1 to len(vempname)
              If instr(1, "abcdefghijklmnopqrstuvwxyz ", mid(vempname, i, 1), vbTextCompare) = 0 then
                errorMsg = "The employee name is invalid. Please re-enter this field."
                Exit For
              End If
            Next
          End If
        End If
        If len(errorMsg) = 0 Then
          If len(vdesign) = 0 Then
            errorMsg = "Your must enter designation."
          Elseif len(vdesign) > 20 Then
            errorMsg = "The employee designation > 20 characters. Please reduce the size."
          Else
            For i = 1 to len(vdesign)
              If instr(1, "_/()[]{}abcdefghijklmnopqrstuvwxyz0123456789 ", mid(vdesign, i, 1), vbTextCompare) = 0 then
                errorMsg = "The employee designaton is invalid. Please re-enter this field."
                Exit For
              End If
            Next
          End If
        End If
        If len(errorMsg) = 0 Then
          If len(vgrade) = 0 Then
            errorMsg = "Your must enter grade of employee."
          Elseif len(vgrade) > 10 Then
            errorMsg = "The grade of employee > 10 characters. Please reduce the size."
          Else
            For i = 1 to len(vgrade)
              If instr(1, "_/()[]{}IVABCDEFGHI12345678 ", mid(vgrade, i, 1), vbTextCompare) = 0 then
                errorMsg = "The grade of employee is invalid. Please re-enter this field."
                Exit For
              End If
            Next
          End If
        End If
        If len(errorMsg) = 0 Then
          If len(vaddress) = 0 Then
            errorMsg = "Your must enter present address of employee."
          Elseif len(vaddress) > 100 Then
            errorMsg = "The address you entered is > 100 characters. Please reduce the size."
          Else
            For i = 1 to len(vaddress)
              If instr(1, ",-s_/()[]{}ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ", mid(vaddress, i, 1), vbTextCompare) = 0 then
                errorMsg = "The address you entered is invalid. Please re-enter address."
                Exit For
              End If
            Next
          End If
        End If
        If len(errorMsg) = 0 Then
          If len(vassesseno) = 0 Then
            errorMsg = "Your must enter assesse no. of employee."
          Elseif len(vassesseno) > 50 Then
            errorMsg = "The assesse no you entered is > 50 characters. Please reduce the size."
          Else
            For i = 1 to len(vassesseno)
              If instr(1, "_/()[]{}abcdefghijklmnopqrstuvwxyz0123456789 ", mid(vassesseno, i, 1), vbTextCompare) = 0 then
                errorMsg = "The assesse no you entered is invalid. Please re-enter assesse no."
                Exit For
              End If
            Next
          End If
        End If
        If len(errorMsg) = 0 Then
          If len(vcontact) = 0 Then
            errorMsg = "Your must enter contact no. of employee."
          Elseif len(vcontact) > 10 Then
            errorMsg = "The contact no. you entered is > 10 characters. Please reduce the size."
          Else
            For i = 1 to len(vcontact)
              If instr(1, "_/()[]{}abcdefghijklmnopqrstuvwxyz0123456789 ", mid(vcontact, i, 1), vbTextCompare) = 0 then
                errorMsg = "The contact no. you entered is invalid. Please re-enter contact no."
                Exit For
              End If
            Next
          End If
        End If
        If len(errorMsg) = 0 Then
          R.Open "Select * from SABF", conn, 2, 3
          R.Addnew
          R("empno") = vempno
          R("empname") = vempname
          R("design") = vdesign
          R("sex") = vsex
          R("grade") = vgrade
          R("category") = vcategory
          R("dob") = Cdate(vdobmm & "/" & vdobdd & "/" & vdobyyyy)
          R("doj") = Cdate(vdojmm & "/" & vdojdd & "/" & vdojyyyy)
          R("dos") = Cdate(vdosmm & "/" & vdosdd & "/" & vdosyyyy)
          R("dojgr") = Cdate(vdojgrmm & "/" & vdojgrdd & "/" & vdojgryyyy)
          R("reason") = vreason
          R("option1") = voption
          R("commutation") = vcommutation
          R("rehabilitation") = vrehabilitation
          R("basic2003") = vbasic2003
          R("stag2003") = vstag2003
          R("personalpay2003") = vpersonalpay2003
          R("splpay2003") = vsplpay2003
          R("adhoc2003") = vadhoc2003
          R("npa2003") = vnpa2003
          R("da2003") = vda2003
          R("protectpay2003") = vprotectpay2003
          R("basic") = vbasic
          R("stag") = vstag
          R("personalpay") = vpersonalpay
          R("splpay") = vsplpay
          R("adhoc") = vadhoc
          R("npa") = vnpa
          R("da") = vda
          R("protectpay") = vprotectpay
          R("beneficiaryspouse") = vbeneficiaryspouse
          R("dobos") = Cdate(vdobosmm & "/" & vdobosdd & "/" & vdobosyyyy)
          R("altnominee1") = valtnominee1
          R("altnominee2") = valtnominee2
          R("altnominee3") = valtnominee3
          R("altnominee4") = valtnominee4
          R("altnominee5") = valtnominee5
          R("altnominee6") = valtnominee6
          R("address") = vaddress
          R("contact") = vcontact
          R("assesseno") = vassesseno
          R("annuityno") = vannuityno
          R("annuityamt") = vannuityamt
          R("onethird") = v1third
          R("refund") = vrefund
          R("monthlypension") = vmonthlypension
          R("choiceopt") = vchoiceopt
          R.UPdate
          R.Close%>
    'CLEAR THE FORM VARIABLES
          <!--#include file="clear_sabf_form_var.inc"--><%
    
        End If
      End If
    '250
    %>
      <div style="Position:Absolute; top:120; left:50; background-color: #f0f0f0">
        <form method="POST" id="myform" name="myform" action="newsabf.asp">
    <%
          If len(errorMsg) > 0 Then
            Response.Write "<p><font color='red'>" & errorMsg & "</font></p>"
          End If
    %>
          <table width=900>
            <tr>
              <table align="center">
                <tr>
                  <td align="center"><font face="arial"><h3>New SABF Entry</h3></font></h3>
                </tr>
    
              </table>
            </tr>
        <hr><br>
            <tr>
              <table align="center">
                <tr>
                  <td align="right"><font face="arial" size=2>Employee No : </font></td>
                  <td align='left'><input type="text" style="width:100px" name="vempno" value="<%=vempno%>"></td>
                  <td align="right"><font face="arial" size=2>Employee Name : </font></td>
                  <td align='left'><input type="text" style="width:300px" name="vempname" value="<%=vempname%>"></td>
                </tr>
                <tr>
                  <td align="right"><font face="arial" size=2>Designation : </font></td>
                  <td align='left'><input type="text" style="width:200px" name="vdesign" value="<%=vdesign%>"/></td>
                  <td align="right"><font face="arial" size=2>Sex : </font></td>
                  <td align='left'>
                    <select name="vsex" value="<%=vsex%>">
                      <option value="" selected>Select</option>
                      <option value="M">Male</option>
                      <option value="F">Female</option>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td align="right"><font face="arial" size=2>Grade : </font></td>
                  <td align='left'>
                    <select name="vgrade" value="<%=vgrade%>">
                      <option value="" selected>Select</option>
                      <%SQL = "SELECT grade FROM grademst ORDER BY grade"
                        R.Open SQL, conn
                        do until R.eof %>
                          <option value="<%=R("grade")%>"><%=R("grade")%></option>
                          <% R.Movenext
                        loop
                      R.Close%>
                    </select>
                  </td>
                  <td align="right"><font face="arial" size=2>Category : </font></td>
                  <td align="left">
                     <font face="arial" size=2><select name="vcategory" value="<%=vcategory%>">
                           <option value=" ">Select</option>
                           <option value="O">Officer</option>
                           <option value="S">Staff</option></select>
                     </font>
                  </td>
                </tr>
                <tr>
                  <td align="right"><font face="arial" size=2>Date of Birth : </font></td>
                  <td>
                    <select name="vdobyyyy" value="<%=vdobyyyy%>">
                      <option value="0">Select</option>
                      <%i=1947
                      do while i <= Cint(year(date())) - 18%>
                            <option value="<%=i%>"><%=i%></option>
                        <%i = i + 1
                      loop%>
                    </select>
                    <select name="vdobmm" value="<%=vdobmm%>">
                      <option value="0"></option>
                      <%i=1
                      Do while i <= 12%>
                          <option value="<%=i%>"><%=i%></option>
                        <%i = i + 1
                      loop%>
                    </select>
                    <select name="vdobdd" value="<%=vdobdd%>">
                      <option value="0"></option>
                      <%If vdobyyyy mod 4 = 0 And vdobmm = 2 Then
                        no_of_day = 29
                      ElseIf vdobyyyy mod 4 <> 0 and vdobmm = 2 Then
                        no_of_day = 28
                      ElseIf vdobmm=4 or vdobmm=6 or vdobmm=9 or vdobmm=11 Then
                        no_of_day = 30
                      Else
                        no_of_day = 31
                      End If
                      i=1
                      Do while i <= no_of_day%>
                          <option value="<%=i%>"><%=i%></option>
                        <%i = i + 1
                      loop%>
                    </select>
                  </td>
                  <td align="right"><font face="arial" size=2>Date of Join : </font></td>
                  <td>
                    <select name="vdojyyyy" value="<%=vdojyyyy%>">
                      <option value=" ">Select</option>
                      <%i=1965
                      do while i <= year(date())%>
                            <option value="<%=i%>"><%=i%></option>
                          <%i = i + 1
                      loop%>
                    </select>
                    <select name="vdojmm" value="<%=vdojmm%>">
                      <option value=" "></option>
                      <%i=1
                      Do while i <= 12%>
                          <option value="<%=i%>"><%=i%></option>
                        <%i = i + 1
                      loop%>
                    </select>
                    <select name="vdojdd" value="<%=vdojdd%>">
                      <option value=" "></option>
                      <%If vdojyyyy mod 4 = 0 And vdojmm = 2 Then
                        no_of_day = 29
                      ElseIf vdojyyyy mod 4 <> 0 and vdojmm = 2 Then
                        no_of_day = 28
                      ElseIf vdojmm=4 or vdojmm=6 or vdojmm=9 or vdojmm=11 Then
                        no_of_day = 30
                      Else
                        no_of_day = 31
                      End If
                      i=1
                      Do while i <= no_of_day%>
                          <option value="<%=i%>"><%=i%></option>
                        <%i = i + 1
                      loop%>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td align="right"><font face="arial" size=2>Date of Seperation : </font></td>
                  <td>
                    <select name="vdosyyyy" value="<%=vdosyyyy%>">
                      <option value=" ">Select</option>
                      <%i=1965
                      do while i <= year(date())%>
                            <option value="<%=i%>"><%=i%></option>
                          <%i = i + 1
                      loop%>
                    </select>
                    <select name="vdosmm" value="<%=vdosmm%>">
                      <option value=" "></option>
                      <%i=1
                      Do while i <= 12%>
                          <option value="<%=i%>"><%=i%></option>
                        <%i = i + 1
                      loop%>
                    </select>
                    <select name="vdosdd" value="<%=vdosdd%>">
                      <option value=" "></option>
                      <%If vdosyyyy mod 4 = 0 And vdosmm = 2 Then
                        no_of_day = 29
                      ElseIf vdosyyyy mod 4 <> 0 and vdosmm = 2 Then
                        no_of_day = 28
                      ElseIf vdosmm=4 or vdosmm=6 or vdosmm=9 or vdosmm=11 Then
                        no_of_day = 30
                      Else
                        no_of_day = 31
                      End If
                      i=1
                      Do while i <= no_of_day%>
                          <option value="<%=i%>"><%=i%></option>
                        <%i = i + 1
                      loop%>
                    </select>
                  </td>
                  <td align="right"><font face="arial" size=2>Date of Join in Grade A : </font></td>
                  <td align='left'>
                    <select name="vdojgryyyy" value="<%=vdojgryyyy%>">
                      <option value=" ">Select</option>
                      <%i=1965
                      do while i <= year(date())%>
                            <option value="<%=i%>"><%=i%></option>
                          <%i = i + 1
                      loop%>
                    </select>
                    <select name="vdojgrmm" value="<%=vdojgrmm%>">
                      <option value=" "></option>
                      <%i=1
                      Do while i <= 12%>
                          <option value="<%=i%>"><%=i%></option>
                        <%i = i + 1
                      loop%>
                    </select>
                    <select name="vdojgrdd" value="<%=vdojgrdd%>">
                      <option value=" "></option>
                      <%If vdojgryyyy mod 4 = 0 And vdojgrmm = 2 Then
                        no_of_day = 29
                      ElseIf vdojgryyyy mod 4 <> 0 and vdojgrmm = 2 Then
                        no_of_day = 28
                      ElseIf vdojgrmm=4 or vdojgrmm=6 or vdojgrmm=9 or vdojgrmm=11 Then
                        no_of_day = 30
                      Else
                        no_of_day = 31
                      End If
                      i=1
                      Do while i <= no_of_day%>
                          <option value="<%=i%>"><%=i%></option>
                        <%i = i + 1
                      loop%>
                    </select><font color='blue' size=2>(If so, in case of staff)</font>
                  </td>
                </tr>
    
                <tr>
                  <td align="right"><font face="arial" size=2>Reason of Seperation</font></td>
                  <td align="left">
                    <select name="vreason" value="<%=vreason%>">
                      <option value=" ">Select</option>
                      <option value="Death">Death</option>
                      <option value="OVSS">OVSS</option>
                      <option value="VRS">VRS</option>
                      <option value="SUP">SUP</option>
                    </select>
                  </td>
                  <td align="right"><font face="arial" size=2>Rehabilitation Option : </font></td>
                  <td align="left">
                    <select name="vrehabilitation" value="<%=vrehabilitation%>">
                      <option value=" ">Select</option>
                      <option value="R1">R1</option>
                      <option value="R2">R2</option>
                      <option value="R3">R3</option>
                    </select>
                  </td>
                </tr>
    
    
              </table>
    
            </tr>
    
            <table align="center"><tr>
                  <td align="right"><font face="arial" size=2>Option opted : </font></td>
                  <td align='left'>
                    <select name="voption" value="<%=voption%>">
                      <option value=" ">Select</option>
                      <%R.Open "SELECT code, description FROM optionopted", conn
                        do until R.eof %>
                          <option value="<%=R("code")%>"><%=R("description")%></option>
                          <%R.Movenext
                        loop
                        R.Close%>
                    </select>
                  </td>
            </tr></table>
    
    
            <tr>
    	  <table align="center" border=1><tr>
               <td align="center"><font face="arial" size=2>As on 2003</font>
                 <table>
                   <tr>
                     <td align="right"><font face="arial" size=2>Basic Salary : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vbasic2003" value="<%=vbasic2003%>"></td>
                   </tr>
                   <tr>
                     <td align="right"><font face="arial" size=2>Stagnation Increment : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vstag2003" value="<%=vstag2003%>"></td>
                   </tr>
                   <tr>
                     <td align="right"><font face="arial" size=2>Personal Pay : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vpersonalpay2003" value="<%=vpersonalpay2003%>"></td>
                   </tr>
                   <tr>
                     <td align="right"><font face="arial" size=2>Special Pay : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vsplpay2003" value="<%=vsplpay2003%>"></td>
                   </tr>
                   <tr>
                     <td align="right"><font face="arial" size=2>Adhoc Pay : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vadhoc2003" value="<%=vadhoc2003%>"></td>
                   </tr>
                   <tr>
                     <td align="right"><font face="arial" size=2>NPA : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vnpa2003" value="<%=vnpa2003%>"></td>
                   </tr>
                   <tr>
                     <td align="right"><font face="arial" size=2>DA : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vda2003" value="<%=vda2003%>"></td>
                   </tr>
                   <tr>
                     <td align="right"><font face="arial" size=2>Protected Pay : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vprotectpay2003" value="<%=vprotectpay2003%>"></td>
                   </tr>
                 </table>
               </td>
               <td align="center"><font face="arial" size=2>As on Superannuation</font>
                 <table>
                   <tr>
                     <td align="right"><font face="arial" size=2>Basic Salary : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vbasic" value="<%=vbasic%>"></td>
                   </tr>
                   <tr>
                     <td align="right"><font face="arial" size=2>Stagnation Increment : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vstag" value="<%=vstag%>"></td>
                   </tr>
                   <tr>
                     <td align="right"><font face="arial" size=2>Personal Pay : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vpersonalpay" value="<%=vpersonalpay%>"></td>
                   </tr>
                   <tr>
                     <td align="right"><font face="arial" size=2>Special Pay : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vsplpay" value="<%=vsplpay%>"></td>
                   </tr>
                   <tr>
                     <td align="right"><font face="arial" size=2>Adhoc Pay : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vadhoc" value="<%=vadhoc%>"></td>
                   </tr>
                   <tr>
                     <td align="right"><font face="arial" size=2>NPA : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vnpa" value="<%=vnpa%>"></td>
                   </tr>
                   <tr>
                     <td align="right"><font face="arial" size=2>DA : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vda" value="<%=vda%>"></td>
                   </tr>
                   <tr>
                     <td align="right"><font face="arial" size=2>Protected Pay : </font></td>
                     <td align='left'><input type="text" style="width:200px" name="vprotectpay" value="<%=vprotectpay%>"></td>
                   </tr>
                 </table>
               </td>
            </table></tr>
            <table><tr>
              <td align="right"><font face="arial" size=2>Name of Beneficiary(Spouse) : </font></td>
              <td align="left"><input type="text" style="width:200px" name="vbeneficiaryspouse" value="<%=vbeneficiaryspouse%>"></td>
                  <td align="right"><font face="arial" size=2>Date of Birth of Spouse : </font></td>
                  <td>
                    <select name="vdobosyyyy" value="<%=vdobosyyyy%>">
                      <option value=" ">Select</option>
                      <%i=1965
                      do while i <= year(date())%>
                            <option value="<%=i%>"><%=i%></option>
                        <%i = i + 1
                      loop%>
                    </select>
                    <select name="vdobosmm" value="<%=vdobosmm%>">
                      <option value=" "></option>
                      <%i=1
                      Do while i <= 12%>
                          <option value="<%=i%>"><%=i%></option>
                        <%i = i + 1
                      loop%>
                    </select>
                    <select name="vdobosdd" value="<%=vdobosdd%>">
                      <option value=" "></option>
                      <%If vdobosyyyy mod 4 = 0 And vdobosmm = 2 Then
                        no_of_day = 29
                      ElseIf vdobosyyyy mod 4 <> 0 and vdobosmm = 2 Then
                        no_of_day = 28
                      ElseIf vdobosmm=4 or vdobosmm=6 or vdobosmm=9 or vdobosmm=11 Then
                        no_of_day = 30
                      Else
                        no_of_day = 31
                      End If
                      i=1
                      Do while i <= no_of_day%>
                          <option value="<%=i%>"><%=i%></option>
                        <%i = i + 1
                      loop%>
                    </select>
                  </td>
            </tr>
            <tr>
              <td align="right"><font face="arial" size=2>Alternate Nominee(1) : </font></td>
              <td align="left"><input type="text" style="width:200px" name="valtnominee1" value="<%=valtnominee1%>"></td>
              <td align="right"><font face="arial" size=2>Alternate Nominee(2) : </font></td>
              <td align="left"><input type="text" style="width:200px" name="valtnominee2" value="<%=valtnominee2%>"></td>
            </tr>
            <tr>
              <td align="right"><font face="arial" size=2>Alternate Nominee(3) : </font></td>
              <td align="left"><input type="text" style="width:200px" name="valtnominee3" value="<%=valtnominee3%>"></td>
              <td align="right"><font face="arial" size=2>Alternate Nominee(4) : </font></td>
              <td align="left"><input type="text" style="width:200px" name="valtnominee4" value="<%=valtnominee4%>"></td>
            </tr>
            <tr>
              <td align="right"><font face="arial" size=2>Alternate Nominee(5) : </font></td>
              <td align="left"><input type="text" style="width:200px" name="valtnominee5" value="<%=valtnominee5%>"></td>
              <td align="right"><font face="arial" size=2>Alternate Nominee(6) : </font></td>
              <td align="left"><input type="text" style="width:200px" name="valtnominee6" value="<%=valtnominee6%>"></td>
            </tr></table>
    
            <table align="center"><tr>
              <td align="right"><font face="arial" size=2>Address : </font></td>
              <td align="left"><input type="text" style="width:700px" name="vaddress" value="<%=vaddress%>"></td>
            </tr></table>
    
            <table align="center">
              <tr>
                <td align="right"><font face="arial" size=2>Contact No : </font></td>
                <td align="left"><input type="text" style="width:100px" name="vcontact" value="<%=vcontact%>"></td>
                  <td align="right"><font face="arial" size=2>1/3 Commutation : </font></td>
                  <td align="left">
                    <select name="vcommutation" value="<%=vcommutation%>">
                      <option value=" ">Select</option>
                      <option value="Y">Yes</option>
                      <option value="N">No</option>
                    </select>
                  </td>
              </tr>
              <tr>
                <td align="right"><font face="arial" size=2>Assess No : </font></td>
                <td align="left"><input type="text" style="width:150px" name="vassesseno" value="<%=vassesseno%>"></td>
                <td align="right"><font face="arial" size=2>Annuity No : </font></td>
                <td align="left"><input type="text" style="width:150px" name="vannuityno" value="<%=vannuityno%>"></td>
              </tr>
              <tr>
                <td align="right"><font face="arial" size=2>Annuity Amount : </font></td>
                <td align="left"><input type="text" style="width:150px" name="vannuityamt" value="<%=vannuityamt%>" id="vannuityamt"/></td>
                <td align="right"><font face="arial" size=2>One Third Commutation : </font></td>
                <td align="left"><input type="text" style="width:150px" name="v1third" value="<%=v1third%>" id="v1third"></td>
              </tr>
              <tr>
                <td align="right"><font face="arial" size=2>Purchase Price Annuity : </font></td>
                <td align="left"><input type="text" style="width:150px" name="vrefund" value="<%=vrefund%>"></td>
                <td align="right"><font face="arial" size=2>Uncommuted Monthly Pension : </font></td>
                <td align="left"><input type="text" style="width:150px" name="vmonthlypension" value="<%=vmonthlypension%>"></td>
              </tr>
              <tr>
                <td align="right"><font face="arial" size=2>Pension amount as per opted : </font></td>
                <td align="left"><input type="text" style="width:150px" name="vchoiceopt" value="<%=vchoiceopt%>"></td>
                <td></td><td></td>
              </tr>
            </table>
    
            <tr>
              <table align="center">
                <tr>
                  <td align="center"><input type="Submit" name="submit" value="Submit">
                                     <input type="reset" name="reset" value="Reset">
                                     <input type="reset" name="back" value="Back" onclick="main()"/>  
                  </td>
                </tr>
              </table>
            </tr>
          </table>
        </form>
        </p>
      </div>
    </body>
    </html>
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    Could you confirm the line number? Are you getting the error on the following line?
    Code:
    <%If vdobyyyy mod 4 = 0 And vdobmm = 2 Then
    If so, please try the following just to make sure it works
    Code:
    <%dim vdobyyyy_alt
    vdobyyyy_alt = 1976
    If vdobyyyy_alt mod 4 = 0 And vdobmm = 2 Then
    If that works, then I think I know what the problem is.

    Jared

    Comment

    • vikas251074
      New Member
      • Dec 2007
      • 198

      #3
      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.

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        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
        Code:
        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
        Code:
        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

        Comment

        • vikas251074
          New Member
          • Dec 2007
          • 198

          #5
          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.

          Code:
                        <td align="right"><font face="arial" size=2>Date of Birth : </font></td> 
                        <td> 
                          <select name="vdobyyyy" value="<%=vdobyyyy%>"> 
                            <option value="0">Select</option> 
                            <%i=1947 
                            do while i <= Cint(year(date())) - 18%> 
                                  <option value="<%=i%>"><%=i%></option> 
                              <%i = i + 1 
                            loop%> 
                          </select> 
                          <select name="vdobmm" value="<%=vdobmm%>"> 
                            <option value="0"></option> 
                            <%i=1 
                            Do while i <= 12%> 
                                <option value="<%=i%>"><%=i%></option> 
                              <%i = i + 1 
                            loop%> 
                          </select> 
                          <select name="vdobdd" value="<%=vdobdd%>"> 
                            <option value="0"></option> 
                            <%If vdobyyyy mod 4 = 0 And vdobmm = 2 Then 
                              no_of_day = 29 
                            ElseIf vdobyyyy mod 4 <> 0 and vdobmm = 2 Then 
                              no_of_day = 28 
                            ElseIf vdobmm=4 or vdobmm=6 or vdobmm=9 or vdobmm=11 Then 
                              no_of_day = 30 
                            Else 
                              no_of_day = 31 
                            End If 
                            i=1 
                            Do while i <= no_of_day%> 
                                <option value="<%=i%>"><%=i%></option> 
                              <%i = i + 1 
                            loop%> 
                          </select> 
                        </td>


          Code of 'clear_sabf_for m_var.inc'
          Code:
          'CLEAR THE FORM VARIABLES
          <%
              vempno = ""
              vempname = ""
              vdesign = ""
              vsex = ""
              vgrade = ""
              vcategory = ""
              vdobyyyy = "0"
              vdobmm = "0"
              vdobdd = "0"
              vdojyyyy = "0"
              vdojmm = "0"
              vdojdd = "0"
              vdosyyyy = "0"
              vdosmm = "0"
              vdosdd = "0"
              vdojgryyyy = "0"
              vdojgrmm = "0"
              vdojgrdd = "0"
              vdobosyyyy = "0"
              vdobosmm = "0"
              vdobosdd = "0"
              vreason = ""
              voption = ""
              vcommutation = ""
              vrehabilitation = ""
              vBasic2003 = "0.00"
              vstag2003 = "0.00"
              vpersonalpay2003 = "0.00"
              vsplpay2003 = "0.00"
              vadhoc2003 = "0.00"
              vnpa2003 = "0.00"
              vda2003 = "0.00"
              vprotectpay2003 = "0.00"
              vBasic = "0.00"
              vstag = "0.00"
              vpersonalpay = "0.00"
              vsplpay = "0.00"
              vadhoc = "0.00"
              vnpa = "0.00"
              vda = "0.00"
              vprotectpay = "0.00"
              vbeneficiaryspouse = ""
              valtnominee1 = ""
              valtnominee2 = ""
              valtnominee3 = ""
              valtnominee4 = ""
              valtnominee5 = ""
              valtnominee6 = ""
              vaddress = ""
              vcontact = ""
              vassesseno = ""
              vannuityno = ""
              vannuityamt = "0.00"
              v1third = "0.00"
              vrefund = "0.00"
              vmonthlypension = "0.00"
              vchoiceopt = "0.00"
          %>

          Comment

          • vikas251074
            New Member
            • Dec 2007
            • 198

            #6
            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.

            Comment

            • jhardman
              Recognized Expert Specialist
              • Jan 2007
              • 3405

              #7
              Originally posted by vikas251074
              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.
              you can cast a value to integer by using the cint() command. Example:
              Code:
              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
              Code:
              vdobyyyy = 0 'this is an integer
              vdobyyyy = "0" 'this is a string
              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
              Code:
              <%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:
              Code:
              <%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

              Comment

              • vikas251074
                New Member
                • Dec 2007
                • 198

                #8
                Yes sir,

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

                vdobyyyy = 0

                then the problem may be solved


                Regards

                Vikas

                Comment

                Working...