<%
'grab the form contents.
fname=Replace(Request.Form("fname"),"'","''")
'use the Replace() function to replace any apostrophe with double
'apostrophes. otherwise you'll get a nasty error message if the
'user types in a value that contains an apostrophe, such as O'Brien.
lname=Replace(Request.Form("lname"), "'", "''")
city=Replace(Request.Form("city"), "'", "''")
service=Replace(Request.Form("service"), "'", "''")
active=request.form("active")
'check to see if the checkbox was checked. if it wasn't then you'll
'need to set the value = 0, otherwise you'll get an error message.
'The value will be 1 if it is checked.
if active = "" then active = 0
Set MyConn=Server.CreateObject("ADODB.Connection")
'uncomment the second connStr if you want to use OLE DB
'also be sure to change the path and database name to yours
connStr="Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:Inetpubwwwroottonydemo.mdb"
'connStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Inetpubwwwroottonydemo.mdb"
SQL = "Insert into Customers(FName, LName, City, Service, Active) Values('"&fname&"','"&lname&"','"&city&"','"&service&"','"&active&"')"
MyConn.Open connStr
MyConn.Execute(SQL)
MyConn.Close
Set MyConn = Nothing
%>
