Re: Duplicate Record with .ADDNEW
- From: Jan Hyde <StellaDrinker@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 13 Nov 2006 08:42:10 +0000
mamin@xxxxxxxxxxxxxxxxx's wild thoughts were released on 10
Nov 2006 18:18:02 -0800 bearing the following fruit:
I will answer all the question what is being asked so far
1) This is in Module and I am using Call Modulename...VB project is
executable and I have schedule this .exe file via Batch to run
periodically. This module reads XML file and creates order and enters
orderitems in two seperate table.
2) Reason I have not created Index is because there may be a genuine
duplicate entry..when two same items being ordered...
3) Weired thing is I have executed same program using the same file on
my local DB and it worked fine and in production server it is causing
this issue. Also, this seems to be for some orders only. I am sure
there is some issue but I am not able to find exact issue.
Have you ruled out the user? I yet to see a database where
users have not duplicated entries.
J
Thanks
Manoj
JP Bless wrote:
<mamin@xxxxxxxxxxxxxxxxx> wrote in message
news:1163162480.339497.240000@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
Lately I am having very strange issue with my code and not sure what is
causig issue.
I have following code which creates new entry in table
===========================================
rsOrderItems.open "tblOrderItems", ConnOrder, adOpenStatic,
adLockOptimistic
rsOrderItems.AddNew
rsOrderItems("OrderId") = pOrderID
rsOrderItems("ProductID") = arrAmazonStoreCart(i, 0)
rsOrderItems("PricePerUnit") = (arrAmazonStoreCart(i, 2) /
arrAmazonStoreCart(i, 1)) 'Line Item total/Qty
rsOrderItems("Qty") = arrAmazonStoreCart(i, 1)
rsOrderItems("Giftwrap") = arrAmazonStoreCart(i, 3)
rsOrderItems("AmazonOrderItemCode") = arrAmazonStoreCart(i, 7)
If Trim(arrAmazonStoreCart(i, 8)) <> "" Then
rsOrderItems("GiftWrapType") = arrAmazonStoreCart(i, 8)
End If
rsOrderItems.Update
rsOrderItems.MoveLast
pOrderItemsID = rsOrderItems("orderitemsid")
rsOrderItems.Close
==============================================
Some times it will create same entry twice. I have been debugging this
issue for two days not able to find out. My best assumption is
happening in above code. If I do the same thing manually it does not
happen so I am not able to recreate issue. However it is keep happening
at least 5 to 10 times a day. This is occasional
Please let me know if anyone had this type of situation before
Thanks
How are you calling the routine? If you are calling it via KeyDown,
Keypress, Click events of any control then watch it...
Jan Hyde (VB MVP)
--
Kleptomaniac: Applauds obsessively (Scot Nelson)
.
- References:
- Duplicate Record with .ADDNEW
- From: mamin
- Re: Duplicate Record with .ADDNEW
- From: JP Bless
- Re: Duplicate Record with .ADDNEW
- From: mamin
- Duplicate Record with .ADDNEW
- Prev by Date: Re: Duplicate Record with .ADDNEW
- Next by Date: Re: Duplicate Record with .ADDNEW
- Previous by thread: Re: Duplicate Record with .ADDNEW
- Next by thread: Re: Duplicate Record with .ADDNEW
- Index(es):
Relevant Pages
|