Inserting 2 times and do not know why- PLS HELP!

Results 1 to 2 of 2

Thread: Inserting 2 times and do not know why- PLS HELP!

  1. #1
    Join Date
    Dec 1969

    Default Inserting 2 times and do not know why- PLS HELP!

    Hi,<BR>i have a serious problem in one of my asp pages. A person can solicit their vacation time on the web. I do a lot of calculations etc, and if they pass through it all then i insert the register into the database(SQLServer2000), the insertion code is not within any loops or if&#039;s, i have NO IDEA why it is trying to insert the record 2 times. Any one have any ideas.<BR>Here&#039;s the code that does the insertion(and yes i&#039;ve done every test i can think of, response.write &#039;s all over the place to see if there was some kind of loop going on, and there is not)...<BR><BR> dim SQL15, rstemp15<BR>SQL15 = "INSERT INTO M4CSP_ABSENCE_REQ (CSP_ORD_REQUEST,STD_ID_HR,STD_OR_HR_PERIOD,SCO_ID _INCIDENCE,CSP_ID_REQ_STATE,CSP_REQ_DATE,CSP_START _ABS,CSP_END_ABS,CSP_HOURS,CSP_COMMENT,CSP_MEDIA_J ORN, CSP_DIAS_TOT,CSP_ID_MANAGER) VALUES(" & max_ord & ",&#039;" & Session("Person") & "&#039;," & Session("ord_hr_period") & ",&#039;" & strtipo & "&#039;,&#039;01&#039;,getdate(),&#039;" & strfeciniR & "&#039;,&#039;" & strfecfinR & "&#039;," & strnumhoras & ",&#039;" & strcomment & "&#039;,&#039;" & strmantarde & "&#039;," & diff & ",&#039;" & manager & "&#039;);"<BR><BR>rstemp15 = conn.execute(SQL15) <BR><BR><BR>if anyone can help i would greatly appreciate it.<BR>rhonda

  2. #2
    Join Date
    Dec 1969

    Default RE: Inserting 2 times and do not know why- PLS HEL

    I once encountered a similar problem, it was caused because we used an &#060;input type="image" src="..." onclick="submit()"&#062;.<BR>Because this input acts as a submit button even without the onclick=submit event, two submits were being done and so two records were inserted in the database. Must be some kind of bug in the browser (I think it was IE55, not sure) to submit the page twiece because of that.<BR>Anyway: your query is probably fine, but the problem may lie somewhere totally different.<BR><BR>

Posting Permissions

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