I got this application from a book and when I try and run it I get an error. Below is the source for the placead.asp. This is the one I get the error on. The link for the website is:
<% Option Explicit %>
<!-- #include file="common/adovbs.inc" -->
<html>
<body bgcolor="#FFFFFF" vlink=red>
<!-- #include file="header.inc" --><p>
<%
' The first time this page is retrieved and any time it is
' submitted without being completely filled out, the form
' is displayed. If it is submitted and completely filled out
' the form is processed in the Else clause.
If Request("Item"="" Or Request("Description"="" Or _
Request("Price"="" Or Request("Phone"="" Or _
Request("Email"="" Or Request("State"="" Then
%>
<% ShowHeader "Place A New Ad" %>
Please fill in all of these fields below. Be sure to choose
an appropriate Category for your item.<p>
Be careful when entering a Password and be sure to remember what
you type. You will be required to enter the password later to
identify you if you need to edit or delete this ad.<p>
When you are finished, click the Place Ad button.<p>
<form method="POST" action="placead.asp">
<table>
<tr><td>Item:</td>
<td><input type="text" size="50" name="Item"></td></tr>
<td valign=top>Description:</td>
<td><textarea name="Description" rows="6" cols="50"></textarea></td></tr>
<tr><td>Category:</td>
<td> <select name="Category" size="1">
<option selected value="VEHICLES">Vehicles</option>
<option value="COMPUTERS">Computers/Software</option>
<option value="REALESTATE">Real Estate</option>
<option value="COLLECTIBLES">Collectibles</option>
<option value="GENERAL">General Merchandise</option>
</select></td></tr>
<tr><td>Price:</td>
<td><input type="text" size="10" name="Price">
</td>
</tr>
<tr><td>Phone</td>
<td><input type="text" size="15" name="Phone">
</td>
</tr>
<tr><td>Email:</td>
<td><input type="text" size="50" name="Email">
</td>
</tr>
<tr><td>State:</td>
<td><input type="text" size="2" name="State">
</td>
</tr>
<tr><td>Password:</td>
<td><input type="password" size="50" name="Password">
</td>
</tr>
<tr><td><input type="submit" value="Place Ad"></td></tr>
</table>
</form>
<% Else %>
<%
Dim Query, Connect, Classifieds, Place
ShowHeader "Place A New Ad"
On Error Resume Next
%>
<font size=5><b>CATEGORY: <%=Request("Category"%></b></font>
<%
ShowItem Request("Item",Request("Description",_
Request("Price",Request("Phone",Request("Email",_
Request("State",Date
Set connect = Server.CreateObject("ADODB.Connection"
'DSN-less connection
'Database must be named classified.mdb
dsnname = "DRIVER=Microsoft Access Driver (*.mdb);DBQ="
dsnname = dsnname & Server.MapPath("db/classified.mdb"
connect.Open dsnname
Set Classifieds = Server.CreateObject("ADODB.Recordset"
Classifieds.Open _
"SELECT * FROM Items WHERE Category='" & _
Request("Category" & "'",_
Connect,adOpenDynamic,adLockOptimistic
Classifieds.AddNew
Classifieds("Item" = Request("Item"
Classifieds("Category" = Request("Category"
Classifieds("Description" = Request("Description"
Classifieds("Price" = Request("Price"
Classifieds("Phone" = Request("Phone"
Classifieds("Email" = Request("Email"
Classifieds("State" = Request("State"
Classifieds("Posted" = Date
Classifieds("Password" = Request("Password"
Classifieds.Update
If Err.Number = 0 Then %>
<font size=5><i>Your classified ad has been placed.</i></font><p>
<a href="default.asp">Home</a><p>
<% Else %>
There was an error placing your ad.<p>
Error #<%=Err.Number%>: <%=Err.Description%><p>
<% End If %>
<% End If %>
</body>
</html>
<% Option Explicit %>
<!-- #include file="common/adovbs.inc" -->
<html>
<body bgcolor="#FFFFFF" vlink=red>
<!-- #include file="header.inc" --><p>
<%
' The first time this page is retrieved and any time it is
' submitted without being completely filled out, the form
' is displayed. If it is submitted and completely filled out
' the form is processed in the Else clause.
If Request("Item"="" Or Request("Description"="" Or _
Request("Price"="" Or Request("Phone"="" Or _
Request("Email"="" Or Request("State"="" Then
%>
<% ShowHeader "Place A New Ad" %>
Please fill in all of these fields below. Be sure to choose
an appropriate Category for your item.<p>
Be careful when entering a Password and be sure to remember what
you type. You will be required to enter the password later to
identify you if you need to edit or delete this ad.<p>
When you are finished, click the Place Ad button.<p>
<form method="POST" action="placead.asp">
<table>
<tr><td>Item:</td>
<td><input type="text" size="50" name="Item"></td></tr>
<td valign=top>Description:</td>
<td><textarea name="Description" rows="6" cols="50"></textarea></td></tr>
<tr><td>Category:</td>
<td> <select name="Category" size="1">
<option selected value="VEHICLES">Vehicles</option>
<option value="COMPUTERS">Computers/Software</option>
<option value="REALESTATE">Real Estate</option>
<option value="COLLECTIBLES">Collectibles</option>
<option value="GENERAL">General Merchandise</option>
</select></td></tr>
<tr><td>Price:</td>
<td><input type="text" size="10" name="Price">
</td>
</tr>
<tr><td>Phone</td>
<td><input type="text" size="15" name="Phone">
</td>
</tr>
<tr><td>Email:</td>
<td><input type="text" size="50" name="Email">
</td>
</tr>
<tr><td>State:</td>
<td><input type="text" size="2" name="State">
</td>
</tr>
<tr><td>Password:</td>
<td><input type="password" size="50" name="Password">
</td>
</tr>
<tr><td><input type="submit" value="Place Ad"></td></tr>
</table>
</form>
<% Else %>
<%
Dim Query, Connect, Classifieds, Place
ShowHeader "Place A New Ad"
On Error Resume Next
%>
<font size=5><b>CATEGORY: <%=Request("Category"%></b></font>
<%
ShowItem Request("Item",Request("Description",_
Request("Price",Request("Phone",Request("Email",_
Request("State",Date
Set connect = Server.CreateObject("ADODB.Connection"
'DSN-less connection
'Database must be named classified.mdb
dsnname = "DRIVER=Microsoft Access Driver (*.mdb);DBQ="
dsnname = dsnname & Server.MapPath("db/classified.mdb"
connect.Open dsnname
Set Classifieds = Server.CreateObject("ADODB.Recordset"
Classifieds.Open _
"SELECT * FROM Items WHERE Category='" & _
Request("Category" & "'",_
Connect,adOpenDynamic,adLockOptimistic
Classifieds.AddNew
Classifieds("Item" = Request("Item"
Classifieds("Category" = Request("Category"
Classifieds("Description" = Request("Description"
Classifieds("Price" = Request("Price"
Classifieds("Phone" = Request("Phone"
Classifieds("Email" = Request("Email"
Classifieds("State" = Request("State"
Classifieds("Posted" = Date
Classifieds("Password" = Request("Password"
Classifieds.Update
If Err.Number = 0 Then %>
<font size=5><i>Your classified ad has been placed.</i></font><p>
<a href="default.asp">Home</a><p>
<% Else %>
There was an error placing your ad.<p>
Error #<%=Err.Number%>: <%=Err.Description%><p>
<% End If %>
<% End If %>
</body>
</html>