<!DOCTYPE html>
<html>
<head>
<title>ADO - Add DataBase Record</title>
</head>
<body>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.mappath("/db/database.mdb"))
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "select * from tblGuestBook", conn
%>
<h2>Adding a Record</h2>
<form method="post" action="demo_db_new.asp" target="_blank">
<table bgcolor="#b0c4de">
<%
for each x in rs.Fields
if x.name <> "no" and x.name <> "dateadded" then%>
<tr>
<td><%=x.name%></td>
<td><input name="<%=x.name%>" value="N/A" size="20"></td>
<%
end if
next
rs.close
conn.close
%>
</tr></table>
<br>
<input type="submit" name="action" value="Add Record">
</form>
<p><a href="showaspcode.asp?source=demo_db_add">View source on how to create input fields based on the fields in the database table</a>.</p>
<p><b>Note:</b> If you click on "Add Record" a new page will open. On the new page you may look at the source on how to add a record to a database table.</p>
</body>
</html>