When a user attempts to add a record to my database via asp if there is already a record they get the following message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] 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.
/Scripts/post_new_data.asp, line 18
Here is my code - can you assist me with displaying my own page in a situation like this?
<%@ LANGUAGE="VBScript" %>
<!--#include file="ADOVBS.inc"-->
<!--#include file="IASUtil.asp"-->
<%
Name = Replace(Request("Name", "'", "''"
Country = Replace(Request("Country", "'", "''"
Model = Replace(Request("Model", "'", "''"
Track = Replace(Request("Track", "'", "''"
Stime = Replace(Request("Stime", "'", "''"
Set Connection = Server.CreateObject("ADODB.Connection"
Connection.Open "DSN=listing"
SQLStmt = "Insert Into stimes ( Name, Country, Model, Track, Stime) "
SQLStmt = SQLStmt & "VALUES ('" & Name & "', '" & Country & "', '" & Model & "', '" & Track & "', '" & Stime & "') "
Set RS = Connection.Execute(SQLStmt)
%>
<HTML>
<HEAD>
<TITLE>Stage Time Added</TITLE>
<HEAD>
<BODY vlink="#0000FF" alink="#0000FF" BGCOLOR="#FFFFFF">
<BR>
<H2>
<font face="Arial">Your Stage Time Has Been Added!<BR>
</font>
</H2>
<font face="Arial">
<BR>
<A HREF="/Scripts/rtrank.asp"><font size="2">View Rally Trophy Rank Data</font></A><font size="2">
</font> </font>
</BODY>
</HTML>
<% Connection.Close %>
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] 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.
/Scripts/post_new_data.asp, line 18
Here is my code - can you assist me with displaying my own page in a situation like this?
<%@ LANGUAGE="VBScript" %>
<!--#include file="ADOVBS.inc"-->
<!--#include file="IASUtil.asp"-->
<%
Name = Replace(Request("Name", "'", "''"
Country = Replace(Request("Country", "'", "''"
Model = Replace(Request("Model", "'", "''"
Track = Replace(Request("Track", "'", "''"
Stime = Replace(Request("Stime", "'", "''"
Set Connection = Server.CreateObject("ADODB.Connection"
Connection.Open "DSN=listing"
SQLStmt = "Insert Into stimes ( Name, Country, Model, Track, Stime) "
SQLStmt = SQLStmt & "VALUES ('" & Name & "', '" & Country & "', '" & Model & "', '" & Track & "', '" & Stime & "') "
Set RS = Connection.Execute(SQLStmt)
%>
<HTML>
<HEAD>
<TITLE>Stage Time Added</TITLE>
<HEAD>
<BODY vlink="#0000FF" alink="#0000FF" BGCOLOR="#FFFFFF">
<BR>
<H2>
<font face="Arial">Your Stage Time Has Been Added!<BR>
</font>
</H2>
<font face="Arial">
<BR>
<A HREF="/Scripts/rtrank.asp"><font size="2">View Rally Trophy Rank Data</font></A><font size="2">
</font> </font>
</BODY>
</HTML>
<% Connection.Close %>