Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Saving with MaskedEdbox in ASP

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
Rajib_D Posted - 20 August 2009 : 09:13:02
Hi I am using MaskedEdbox in ASP. But I am having problem in saving the MaskedEdBox value to the database(sql server 2005 Express).I got no problem in saving the other Text boxes fields.Can anybody help me to solve my problem.

I had made 2 asp pages 1) x.asp and the other contain add.asp
I would like to mention Though its already in the code , Object ClassID of the MaskedEdbox is
<object classid="clsid:C932BA85-4374-101B-A56C-00AA003668DC" id="DTP" width="110" height="21">

*********************This code contains x.asp*****************************
<HTML>
<Head>
<TITLE>JJ</TITLE> 
</head>
<body>
<BR>
<form Name = "myForm" method="post" action="http://localhost/Aspex/add.asp">
  <div align="center" style="width: 1146; height: 512">
    <center>
    <div align="center">
      <center>
    <table border="1" width="63%" height="1" bordercolor="#FFFFFF" bgcolor="#800000" align = "Center">
      <tr>
        <td width="100%" height="53">
          <font color="#FFFFFF"><b><u>Employee Master</u></b></font></td>
      </tr>
      <tr>
        <td width="100%" height="1"><font color="#FFFFFF"><span style="background-color: #800000">
           </span></font>
          <p><font color="#FFFFFF"><span style="background-color: #800000">
          <b>ID</b></span><b><span style="background-color: #800000"> </span></b></font><input type="text" name="ID" size="20">
          </p>
          <p><font color="#FFFFFF"><span style="background-color: #800000"><b>
          Employee Name</b></span> </font>    <input type="text" name="Name" size="20"></p>
          <p>
          <font color="#FFFFFF"><b>Address</b></font>
          <input type="text" name="Address" size="36"></p>
          <p>
          <b><font color="#FFFFFF">Phone</font></b>
          <input type="text" name="phone" size="26"></p>
          <p>
       
</SPAN>
          <p><font color="#FFFFFF"><span style="background-color: #800000">
          <b>Date-Of-Joining 
          <object classid="clsid:C932BA85-4374-101B-A56C-00AA003668DC" id="DTP" width="110" height="21">
            <param name="_ExtentX" value="2910">
            <param name="_ExtentY" value="556">
            <param name="_Version" value="393216">
            <param name="BorderStyle" value="1">
            <param name="ClipMode" value="0">
            <param name="MousePointer" value="0">
            <param name="Appearance" value="1">
            <param name="BackColor" value="-2147483643">
            <param name="ForeColor" value="-2147483640">
            <param name="PromptInclude" value="-1">
            <param name="AllowPrompt" value="-1">
            <param name="AutoTab" value="0">
            <param name="HideSelection" value="-1">
            <param name="Enabled" value="-1">
            <param name="MaxLength" value="10">
            <param name="OLEDragMode" value="0">
            <param name="OLEDropMode" value="0">
            <param name="Format" value="dd-mm-yyyy">
            <param name="Mask" value="##-##-####">
            <param name="PromptChar" value="_">
            <param name="OLEDragMode" value="0">
            <param name="OLEDropMode" value="0">
          </object>
          </b></span></font>
        </p> 

      </tr>
      <tr>
        <td width="100%" height="75">
          <input type="Submit" value="Submit"  name="Submit">   <input type="Button" value="Logoff" "Logoff" name="Logoff">
<font color="#FFFFFF"><b>
          <A HREF = "http://localhost/Aspex/Results.asp">Preview Results</A>
          </b></font>
        </td>
      </tr>
    </table>
      </center>
    </div>

    </center>
</form>
</body>
</html>


**********************This Code Contains add.asp *********************
<%@ Language=VBScript%> 

<% if Request.Form("ID") = "" OR Request.Form("Name") = "" Then %>
<SCRIPT LANGUAGE = "VBScript">
<!--
location.href = "x.asp"
-->
</SCRIPT>
<%end if%>

<%
if Not Request.Form("ID") = "" And Not Request.Form("Name") = "" Then
Dim Conn,sql,rs
set Conn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.Recordset")
Conn.Open("sample")
sql="select * from Employee_Master"
rs.Open sql,Conn,1,3
do while Not rs.eof
if rs.Fields("ID") = Request.Form("ID") Then
Response.Redirect("Duplicate.HTML")
end if
rs.MoveNext
loop
end if
%>
<%
if Not Request.Form("ID") = "" And Not Request.Form("Name") = "" Then
rs.AddNew
rs.Fields("ID") = Request.Form("ID") 
rs.Fields("Name") = Request.Form("Name") 
rs.Fields("Address") = Request.Form("Address")
rs.Fields("phone") = Request.Form("phone")
rs.Fields("DOJ") = Request.Form("DTP")
rs.Update
rs.close
Conn.Close
set Conn = Nothing
Response.Redirect("Results.asp")
end if
%>
1   L A T E S T    R E P L I E S    (Newest First)
AnonJr Posted - 20 August 2009 : 09:50:34
While we do answer the occasional non-forum related code question, you might find you get a faster response over at http://stackoverflow.com

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.45 seconds. Powered By: Snitz Forums 2000 Version 3.4.07