Could you help me solve this error?
Error Type:
Microsoft JET Database Engine (0x80040E21)
The changes you requested to the table were not successful because they
would create duplicate values in the index, primary key, or relationship.
Change the data in the field or fields that contain duplicate data, remove
the index, or redefine the index to permit duplicate entries and try again.
/final/verification.asp, line 36
Here is the code.
<%
dim objconn, objrs, objconn2, objrs2
set objconn = Server.CreateObject("ADODB.Connection")
'set objconn2 = Server.CreateObject("ADODB.Connection")
set objrs = Server.CreateObject("ADODB.Recordset")
set objrs2 = Server.CreateObject("ADODB.Recordset")
strconnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\inetpub\wwwroot\final\EventRegistration.mdb;Persist Security
Info=False"
objconn.open strconnection
objrs.open "Registration", objconn, 3, 3
objrs2.open "Select * from events where EventID = '" & request.form
("eventid") & "' and EventDate = #" & request.form("eventdate") & "#",
objconn, 3, 3, 1
'If objRS.EOF Then
' Response.redirect "login.asp"
'Else
' If objRS("NumberOfAttendees") = 30 then
' Response.write "That event is currently full, please try
another event."
' objRS.close
'End If
'End If
'If not objRS.EOF then
' Response.redirect "login.asp"
'Else
If objRS2("NumberofAttendees") = 30 then
Response.write "That event is currently full, please try another
event."
objrs2.close
Else
objRS.AddNew
objRS("CustomerNumber") = Request.Form("userid")
objRS("EventID") = Request.Form("eventid")
objRS("EventDate") = Request.form("eventdate")
objRS.Update
objRS.Close
Response.Write "You have registered for event " & request.form
("eventid") & " on " & request.form("eventdate") & "."
End If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 2</title>
</head>
<body background="../back0641.jpg">
<%
dim strcustomer, streventid, streventdate
strcustomer = request.form("customer")
streventid = request.form ("eventid")
streventdate = request.form("eventdate")
%>
<p align="center"><font size="7" color="#FF0000">Verification</font></p>
<table border="1" width="100%">
<tr>
<td width="17%">User ID:</td>
<td width="83%"><%strcustomer%></td>
</tr>
</table>
<table border="1" width="100%">
<tr>
<td width="17%">Event ID:</td>
<td width="83%"> <%streventid%></td>
</tr>
</table>
<table border="1" width="100%">
<tr>
<td width="17%">Event Date:</td>
<td width="83%"> <%streventdate%></td>
</tr>
</table>
<p align="center"><a href="register.asp">Back to Registration Page</a></p>
<p align="center"><font size="5" color="#0000FF"><a href="login.asp">Home
Page</a></font></p>
</body>
</html>
Thank!
Tammy Kitzman