how to write codes to connect access database using html codes

Discussion in 'Software' started by hiralcp, Dec 18, 2007.

  1. hiralcp

    hiralcp

    Joined:
    Dec 18, 2007
    Messages:
    3
    Please somebody help me with my codes. I am trying to Insert the data to access database using Html and javascript. but it doesnt work...my codes are as below:

    <html>
    <head>

    <title>Feedback Form</title>

    <script type="text/javascript">



    function getSubmit()
    {

    var name,email,comments;

    name1=uname.value;
    email=email.value;
    comments=commnets.value;

    var cn = new ActiveXobject("ADODB.Connection");

    var rs = new ActiveXObject("ADODB.Recordset");

    var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Documents and Settings\Velosys2-office\My Documents\feedback\Users.mdb";

    var SQL = "INSERT INTO user_tbl(uName,Email,Comments) VALUES (" & "'" & name1 & "'," & "'" & email & "'," & "'" & commnets & "')";

    cn.Open(strConn);
    rs.Open(SQL, cn);
    rs(1)=name.value;
    rs(2)=email.value ;
    rs(3)=comments.value;

    rs.Close();
    cn.Close();
    response.write("your data is submited");

    }

    </script>
    </head>

    <body>

    <div align="center">
    <table width="80%" border="0">
    <td><b>FEEDBACK FORM</b></td>
    <tr>
    <td>Name :</td>
    <td><input type="text" name="uname" ></td>
    </tr>
    <tr>
    <td>Email :</td>
    <td> <input type="text" name="email"></td>
    </tr>
    <tr>
    <td>Comments :</td>
    <td><textarea name="comments"></textarea></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td><input type="button" value="submit" onclick="getSubmit();"> </td>
    </tr>
    </table>
    </div>

    </body>
    </html>

    Looking forward for help.
    Thanks
     
    hiralcp, Dec 18, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guy Cox
    Replies:
    1
    Views:
    1,396
    sharon
    Jul 9, 2003
  2. Fluker
    Replies:
    0
    Views:
    1,089
    Fluker
    Jul 9, 2003
  3. Frank
    Replies:
    3
    Views:
    655
    Ryan Walberg
    Feb 13, 2004
  4. scott93727@gmail.com

    DataBase DataBase DataBase DataBase

    scott93727@gmail.com, Sep 26, 2012, in forum: Computer Information
    Replies:
    0
    Views:
    1,135
    scott93727@gmail.com
    Sep 26, 2012
  5. scott93727@gmail.com

    Database Database Database Database

    scott93727@gmail.com, Sep 27, 2012, in forum: Computer Information
    Replies:
    0
    Views:
    987
    scott93727@gmail.com
    Sep 27, 2012
Loading...

Share This Page