Hi,
I'm using VB5 and ADO. I have 2 tables, one to store the transactions, the other to store the last reference number assigned to the transactions.
Main:
call A until EOF
Function A:
oData.BeginsTrans
call getRef 'to get the next reference number
oData.Execute "Insert ..." 'to insert transactions with reference number as primary key.
oData.CommitTrans
Function getRef:
Select the last reference number used from database (eg 32)
Increment by one (eg 33)
Update the last reference number to 33
Return the reference number to function A.
My problems starts on the 2nd time function A is called. If I run in VB debug mode step by step, I'm able to select the last reference number (33). But if I run the exe, my selection returns 32.
Can anyone please tell me where my 33 went to even after I committed the transactions? :-( Thank you..
I'm using VB5 and ADO. I have 2 tables, one to store the transactions, the other to store the last reference number assigned to the transactions.
Main:
call A until EOF
Function A:
oData.BeginsTrans
call getRef 'to get the next reference number
oData.Execute "Insert ..." 'to insert transactions with reference number as primary key.
oData.CommitTrans
Function getRef:
Select the last reference number used from database (eg 32)
Increment by one (eg 33)
Update the last reference number to 33
Return the reference number to function A.
My problems starts on the 2nd time function A is called. If I run in VB debug mode step by step, I'm able to select the last reference number (33). But if I run the exe, my selection returns 32.
Can anyone please tell me where my 33 went to even after I committed the transactions? :-( Thank you..