duplicate records inserted into access DB
Author |
Message |
Jeff Watts-Ro #1 / 5
|
 duplicate records inserted into access DB
I am using an "INSERT INTO" statement from VBScript to a MS Access database that is inserting duplicate rows: INSERT INTO order_detail ( orderid, productid, description, unit_of_measure, color_misc, qty, price, entry_date, small_desc ) values (54878112, 20, 'Book 1', '320 pps', 'n/a', 1, 13.95, '1/4/01 5:44:21 PM', 'Healthy Hair & Nails') When I do a select on the order_detail table, I see this: 176 54878112 20 Book 1320 pps n/a 1 13.95 1/4/01 5:44:21 PM Healthy Hair & Nails 177 54878112 20 Book 1320 pps n/a 1 13.95 1/4/01 5:44:21 PM Healthy Hair & Nails When I do a response.write to show the sql statement, I notice nothing wrong. Additionally, the insert is not done in a loop, etc. It is merely one sql statement that does TWO inserts. Is this a BUG? The webserver is IIS 4.0, the table is Access2000 SR1. I can send more detailed code samples to anyone who might know what causes this problem. Thanks in advance, Jeff Watts-Roy
|
Tue, 24 Jun 2003 12:23:20 GMT |
|
 |
Jeff Watts-Ro #2 / 5
|
 duplicate records inserted into access DB
Looks like it may have been due to an implicit update to an autonumber field (my error). This is a noted issue and once I found the documentation in MSDN I checked to see if this is what was going on. Jeff Watts-Roy
Quote: > I am using an "INSERT INTO" statement from vbscript to a MS Access database > that is inserting duplicate rows: > INSERT INTO order_detail ( orderid, productid, description, unit_of_measure, > color_misc, qty, price, entry_date, small_desc ) values (54878112, 20, 'Book > 1', '320 pps', 'n/a', 1, 13.95, '1/4/01 5:44:21 PM', 'Healthy Hair & Nails') > When I do a select on the order_detail table, I see this: > 176 54878112 20 Book 1320 pps n/a 1 13.95 1/4/01 5:44:21 PM Healthy Hair & > Nails > 177 54878112 20 Book 1320 pps n/a 1 13.95 1/4/01 5:44:21 PM Healthy Hair & > Nails > When I do a response.write to show the sql statement, I notice nothing > wrong. Additionally, the insert is not done in a loop, etc. It is merely one > sql statement that does TWO inserts. Is this a BUG? > The webserver is IIS 4.0, the table is Access2000 SR1. I can send more > detailed code samples to anyone who might know what causes this problem. > Thanks in advance, > Jeff Watts-Roy
|
Tue, 24 Jun 2003 15:39:12 GMT |
|
 |
Jeff Watts-Ro #3 / 5
|
 duplicate records inserted into access DB
Just for everyone's edification. It is not the autonumber thing. It is the fact that I am submitting a form using an <INPUT TYPE="Image"> and it submits the form twice! My image input calls a javascript function that submits the form. It was submitting twice if I the user clicks enter while any of the form elements had focus.
Quote: > Looks like it may have been due to an implicit update to an autonumber field > (my error). This is a noted issue and once I found the documentation in MSDN > I checked to see if this is what was going on. > Jeff Watts-Roy
> > I am using an "INSERT INTO" statement from vbscript to a MS Access > database > > that is inserting duplicate rows: > > INSERT INTO order_detail ( orderid, productid, description, > unit_of_measure, > > color_misc, qty, price, entry_date, small_desc ) values (54878112, 20, > 'Book > > 1', '320 pps', 'n/a', 1, 13.95, '1/4/01 5:44:21 PM', 'Healthy Hair & > Nails') > > When I do a select on the order_detail table, I see this: > > 176 54878112 20 Book 1320 pps n/a 1 13.95 1/4/01 5:44:21 PM Healthy Hair & > > Nails > > 177 54878112 20 Book 1320 pps n/a 1 13.95 1/4/01 5:44:21 PM Healthy Hair & > > Nails > > When I do a response.write to show the sql statement, I notice nothing > > wrong. Additionally, the insert is not done in a loop, etc. It is merely > one > > sql statement that does TWO inserts. Is this a BUG? > > The webserver is IIS 4.0, the table is Access2000 SR1. I can send more > > detailed code samples to anyone who might know what causes this problem. > > Thanks in advance, > > Jeff Watts-Roy
|
Wed, 25 Jun 2003 00:36:45 GMT |
|
 |
Charlie Brac #4 / 5
|
 duplicate records inserted into access DB
If you're on an ASP page, it's possible the query is being run twice even though it's not inside a loop or anything just because of the way ASP processes. I'd look at all my client-side and server-side stuff and do a mental walk-through to be sure of what is executing when, and in this case, how often. cb
Quote: > I am using an "INSERT INTO" statement from vbscript to a MS Access database > that is inserting duplicate rows: > INSERT INTO order_detail ( orderid, productid, description, unit_of_measure, > color_misc, qty, price, entry_date, small_desc ) values (54878112, 20, 'Book > 1', '320 pps', 'n/a', 1, 13.95, '1/4/01 5:44:21 PM', 'Healthy Hair & Nails') > When I do a select on the order_detail table, I see this: > 176 54878112 20 Book 1320 pps n/a 1 13.95 1/4/01 5:44:21 PM Healthy Hair & > Nails > 177 54878112 20 Book 1320 pps n/a 1 13.95 1/4/01 5:44:21 PM Healthy Hair & > Nails > When I do a response.write to show the sql statement, I notice nothing > wrong. Additionally, the insert is not done in a loop, etc. It is merely one > sql statement that does TWO inserts. Is this a BUG? > The webserver is IIS 4.0, the table is Access2000 SR1. I can send more > detailed code samples to anyone who might know what causes this problem. > Thanks in advance, > Jeff Watts-Roy
|
Sat, 19 Jul 2003 06:30:59 GMT |
|
 |
Jeff Watts-Ro #5 / 5
|
 duplicate records inserted into access DB
yes, this was the case--my input type (an image) was doing a double submit in conjunction with my javascript form.submit. Thanks, Jeff Watts-Roy
Quote: > If you're on an ASP page, it's possible the query is being run twice even > though it's not inside a loop or anything just because of the way ASP > processes. I'd look at all my client-side and server-side stuff and do a > mental walk-through to be sure of what is executing when, and in this case, > how often. > cb
> > I am using an "INSERT INTO" statement from vbscript to a MS Access > database > > that is inserting duplicate rows: > > INSERT INTO order_detail ( orderid, productid, description, > unit_of_measure, > > color_misc, qty, price, entry_date, small_desc ) values (54878112, 20, > 'Book > > 1', '320 pps', 'n/a', 1, 13.95, '1/4/01 5:44:21 PM', 'Healthy Hair & > Nails') > > When I do a select on the order_detail table, I see this: > > 176 54878112 20 Book 1320 pps n/a 1 13.95 1/4/01 5:44:21 PM Healthy Hair & > > Nails > > 177 54878112 20 Book 1320 pps n/a 1 13.95 1/4/01 5:44:21 PM Healthy Hair & > > Nails > > When I do a response.write to show the sql statement, I notice nothing > > wrong. Additionally, the insert is not done in a loop, etc. It is merely > one > > sql statement that does TWO inserts. Is this a BUG? > > The webserver is IIS 4.0, the table is Access2000 SR1. I can send more > > detailed code samples to anyone who might know what causes this problem. > > Thanks in advance, > > Jeff Watts-Roy
|
Mon, 28 Jul 2003 10:41:33 GMT |
|
|
|