473,382 Members | 1,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

vb6 adding new records in access misses out some records

i am not good in programming and i need help

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
  1. Dim rs5 As New ADODB.Recordset
  2. Dim rs6 As New ADODB.Recordset
  3.  
  4. With rs5
  5.         If rs5.State = 1 Then Set rs5 = Nothing
  6.  
  7. rs5.Open "Select * from [TEMDB]", cnn2, adOpenDynamic, adLockPessimistic
  8.  
  9.    CnDBS.BeginTrans
  10.  
  11.         Do While Not .EOF
  12.  
  13.                 If rs6.State = 1 Then Set rs6 = Nothing
  14.  
  15.             With rs6
  16.                   rs6.Open "Select * from PERMANENTDB", CnDBS, adOpenDynamic, adLockPessimistic
  17.  
  18. If err.Number = 3021 Then MsgBox "Please Clear (F4) and restart your transaction": Exit Function
  19.  
  20.                         rs6.AddNew
  21.  
  22.                                  rs6.Fields(0) = ThisTill & receipt
  23.                                  rs6.Fields(1) = ThisTill
  24.                                  rs6.Fields(2) = Tilluser
  25.                                  rs6.Fields(3) = rs5.Fields(10).Value
  26.                                  rs6.Fields(4) = rs5.Fields(5).Value
  27.                                  rs6.Fields(5) = rs5.Fields(6).Value
  28.                                  rs6.Fields(6) = rs5.Fields(7).Value
  29. '                   rs6.Update '' I USED TO HAVE UPDATE HERE STILL WITH SAME PROBLEM
  30.  
  31.             End With
  32.             rs5.MoveNext
  33.         Loop
  34.  
  35.  
  36.     rs5.Close
  37.  Set rs5 = Nothing
  38.  
  39. End With
  40.  
  41. rs6.Update
  42. CnDBS.CommitTrans
  43.  
  44.  
at this stage the temporary database is used to print confirmation records that they have been entered then all records are deleted from the temporary database.
Nov 1 '09 #1
1 1579
Dököll
2,364 Expert 2GB
Intense! Good job getting it to do that much thus far.... can you set up a timer to control how frequently data get loaded to permanent db...

Dököll
Nov 5 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Jamie Fryatt | last post by:
Hi everyone, here's what id like to do. I have a table with 2 fields, name and value I need to be able to add multiple records quickly, for example I need to add name value abc 1...
6
by: Robin S. | last post by:
**Eric and Salad - thank you both for the polite kick in the butt. I hope I've done a better job of explaining myself below. I am trying to produce a form to add products to a table (new...
3
by: John Duchowski | last post by:
I've got a fairly large Access file with 4899 records. The ID field runs sequentially but misses two rows: it skips 3727 and 3740. Consequently, the dbase indicates that I have 4901 rows where in...
8
by: shumaker | last post by:
I'm wondering if adding an autonumber primary key will improve the performance of a multiuser access database on a network share. I have a website that lists many tips for improving performance of...
12
by: tjmoses | last post by:
I've been lurking on this board for about 4 years now, getting great answers and solutions to many, many Access and VBA questions that I've had over the years. I was hoping that you all could pass...
1
by: Catriona | last post by:
I am developing an Access application where users insert bill records for an electricity account by clicking on a new button. The required workflow is 1) New button clicked 2) New record appears...
1
by: vbDavidC | last post by:
I am adding a new record to a table via a dataset/adapter. I have got the following to work for me but I am wondering if there is a better way to do this. I am having to have something in my...
2
by: Steve | last post by:
I have zero experience with ODBC. If I have an Access frontend connected to a SQL Database using ODBC, are the tables connected like a frontend/backend Access database where the the tables you see...
4
by: jake | last post by:
I am new to multi-threading. Here is my scenario: foreach (<file in a certain folder>) new Thread((ThreadStart)(delegate { processFile(<file>); })).Start(); sometimes misses firing some...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.