Jump to content

how to insert data into ms access


quyen

Recommended Posts

i'm trying to create a new record in ms access. i have page 1) which requests users information in a form, and page 2) which should create the actual record for the database. i'm not sure how to execute this(take a look at 'what should I include here to insert record into database? section in page 2), please take a look at my code, thanks Page 1)-asks users to insert information into a form<%language="vbscript"%><!--#include file="connections.asp"--><html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css"><!--body { background-color: #996600;}--></style><basefont face="cursive"></head><body><h1 align="center"> Discussion Forum </h1><table border="1" width="100%" bgcolor="#fff5ee"><tr><%for each x in rs.Fields response.write("<th align='left' bgcolor='#b0c4de'>" & x.name & "</th>")next%></tr><%do until rs.EOF%> <tr> <%for each x in rs.Fields%> <td><%Response.Write(x.value)%></td> <%next rs.MoveNext%> </tr><%looprs.closeconn.close%></table><form action="forumCommentAdd2.asp" method="post"><table border = "1" width = 50% align="center"> <tr> <td align="center">Post a message </td> <tr> <tr> <td>Enter Name:<input type="text" name="name"> Date:<input type="text" name="date"></td> </tr> <tr> <td>Comment:<textarea name="comment" cols="35" rows="6" wrap="physical"></textarea></td> <tr> <tr> <td align="center"><input type="submit" name="addComment" value="Post Message"></td> </tr></table></form></body></html></body></html>Page 2) this is the forumAddComment2.asppagewhichshould insert the new record into database<%@language="vbscript"%><!--#include file="connections.asp"--><%'what should I include here to insert record into database?%><html><head><title>SQL Add record example</title></head><body><h2 align="center">Your comments have been added to the forum</h2><br><br><p align="center"><a href="forum.asp">Return to Discussion Forum </a></p></body></html>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...