Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > Software > how to write codes to connect access database using html codes

Reply
Thread Tools

how to write codes to connect access database using html codes

 
 
hiralcp hiralcp is offline
Junior Member
Join Date: Dec 2007
Posts: 3
 
      12-18-2007
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Virtual Key Codes, Scan Codes and ASCII Codes in C gj_williams2000@yahoo.co.uk C Programming 2 08-20-2005 11:04 AM
RegEx replace of html codes to ascii codes Greg -- ASP .Net 4 08-09-2005 07:27 PM



Advertisments