vijithamar
Programmer
My Vb6 code to write different tables in database
is like this ( i am using Access 97 Database )
Private Sub WriteBill()
on error goto errmsg
DBEngine.BeginTrans
DBEngine.Idle dbRefreshCache
Set rssysrec = Ab2.OpenRecordset("select * from invsystem", dbOpenDynaset)
rssysrec.Edit
rssysrec!invnoca = rssysrec!invnoca + 1
inum = rssysrec!invnoca
rssysrec.Update
For i=1 to n
'checking for available stock
Set tmprs = Ab2.OpenRecordset("Select product.cmcode,batch.brate from batch,product..... [Opening a Recorset]
'updataing stock (Deducting)
Ab2.Execute "update batch, product .... [two table is updating]
'Writing Transaction table1
Ab2.Execute "insert into invmonthly.... [Appending records to a table]
Next i
'Writing Transaction table2
Ab2.Execute insert into invtotal.... [Appending records to a table]
DBEngine.CommitTrans dbFlushOSCacheWrites
DBEngine.Idle dbRefreshCache
Exit Sub
Errmsg:
Errormsg
End Sub
Ab2 is a global database type variable
it is a multi-user busy retail billing system (10 user)
the problem occurs very rarely
the problem is INSERT INTO statements are not inserting the records to the tables
update command is working fine
in result The product stock quantity deducting but there is no transaction records found
the problem occurs very very rarely, say one transaction out of 1000
i checked allow zero length,default values,validations of every field all are ok
system working in win98
hope anybody will give me a solution for this problem
Thanks