Weird Problem, Please Read!

Results 1 to 3 of 3

Thread: Weird Problem, Please Read!

  1. #1
    NJ Guest

    Default Weird Problem, Please Read!

    I&#039;m running a small website off my IIS server using ASP and an Access Database with 1 table named &#039;Table1&#039; and 17 fields. <BR>Several people have created accounts by adding their info into Table1, but the submit script isn&#039;t working for others...<BR> check out my page and try it yourself. <BR><BR>A lot of people are getting this error...<BR><BR>Error Type:<BR>Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)<BR>[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.<BR>/createsubmit.asp, line 45<BR><BR>My Script looks like this...<BR><BR>line 44: strSQL = "INSERT INTO Table1 MName, MDate, PW, CPW, Zip, MMail, How, MOcc, MHob, MAOL, MYah, MURL, MURL2, MURL3, Shout) VALUES (&#039;" & strMName & "&#039;, &#039;" & strMDate & "&#039;, &#039;" & strPW & "&#039;, &#039;" & strCPW & "&#039;, &#039;" & strZip & "&#039;, &#039;" & strMMail & "&#039;, &#039;" & strHow & "&#039;, &#039;" & strMOcc & "&#039;, &#039;" & strMHob & "&#039;, &#039;" & strMAOL &"&#039;, &#039;"& strMYah & "&#039;,&#039;"& strMURL &"&#039;,&#039;"& strMURL2 &"&#039;,&#039;" & strMURL3 &"&#039;,&#039;" & strShout &"&#039;)"<BR> <BR>line 45: Conn.Execute strSQL<BR><BR>Props to anyone that can figure out this hair-pulling problem!

  2. #2 Guest

    Default RE: Weird Problem, Please Read!

    Well this is obviously a problem caused by your database design.<BR>You must have a unique key defined on your table, and you must be trying to insert the same record twice. Maybe the user is clicking the submit button a second time, while the first submission is still being processed (I note that your response time is a bit slow.). I actually created a new account, and re-submitted it with no problem. After the first submission succeeded, the others responded with message saying that my details were updated. So it looks to be working properly.<BR><BR>I suggest you put a please wait (or be patient) message up and a warning about not hitting the submit a second time. You might need to set a session variable to check on the server side for repeat submission. Or you may need to look at the logic around your SQL Insert command (ie check to see if user already exists before executing submit).

  3. #3
    NJ Guest

    Default Solved my own problem

    Thanks for looking into that Petejl, but I solved my own problem soon after I asked for help :P You were right, the problem was in my databse, I needed to allow indexing and allow duplicates on all my fields for it to work. Thanks for the additional advice, I&#039;m out. -NJ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts