i wrote a program in VB6 that uses MS access database, its supposed to save records into a temporary database, when you are happy with the records it copies them to a permanent database, then deletes all contents in the temporary database in order to enter new records, this process is repeated over and over again but, sometimes very fast, when i checked the permanent database i have noticed that i have less records than those entered, through temp database,
eg suppose i enter 3 records at a time into temporary database 10 times totaling 30 records, in the permanent database i get maybe only 16 0r 20 records, surprisingly the same program is working fine on a pentium 4 PC or on dual core laptop, but on Pentium 3, 500Mhz CPU 128MB ram 4GB Hdd this problem surfaces,
could it be the machine speed or something can be dane in the code?
Expand|Select|Wrap|Line Numbers
- Dim rs5 As New ADODB.Recordset
- Dim rs6 As New ADODB.Recordset
- With rs5
- If rs5.State = 1 Then Set rs5 = Nothing
- rs5.Open "Select * from [TEMDB]", cnn2, adOpenDynamic, adLockPessimistic
- CnDBS.BeginTrans
- Do While Not .EOF
- If rs6.State = 1 Then Set rs6 = Nothing
- With rs6
- rs6.Open "Select * from PERMANENTDB", CnDBS, adOpenDynamic, adLockPessimistic
- If err.Number = 3021 Then MsgBox "Please Clear (F4) and restart your transaction": Exit Function
- rs6.AddNew
- rs6.Fields(0) = ThisTill & receipt
- rs6.Fields(1) = ThisTill
- rs6.Fields(2) = Tilluser
- rs6.Fields(3) = rs5.Fields(10).Value
- rs6.Fields(4) = rs5.Fields(5).Value
- rs6.Fields(5) = rs5.Fields(6).Value
- rs6.Fields(6) = rs5.Fields(7).Value
- ' rs6.Update '' I USED TO HAVE UPDATE HERE STILL WITH SAME PROBLEM
- End With
- rs5.MoveNext
- Loop
- rs5.Close
- Set rs5 = Nothing
- End With
- rs6.Update
- CnDBS.CommitTrans