VB3.0 Data Access question

VB3.0 Data Access question

Post by Carl Hilto » Tue, 10 Dec 1996 04:00:00



I have to import about 300K number of records into an access database.  I had unloaded VB3.0 from my
machine and have recently reloaded it.

1) Wasn't there something I had to do to get VB3.0 to read/write ACCESS2.0?

2) I have programmed my VB application to create a database and table.  My question is what is the easiest
means to put these 300K records into the database?

Is there a speed hit if I chose table over dynaset?  This is a single user database.

Right now it looks like I need to

For x = 1 to 300000
  MyTable.AddNew
  MyTable("Field1") = value
  MyTable("Field2") = value
  MyTable("Field3") = value
  MyTable("Field4") = value
  MyTable("Field5") = value
  MyTable.Update
next x

This would appear to be harddrive intensive and I was hoping for a more efficient method.

Sorry if this is in the wrong news group but I know what ..vb.database.odbc is and don't know what DAO or
RDO are so was not sure the appropriate group to post..

 
 
 

VB3.0 Data Access question

Post by James A. Colli » Fri, 13 Dec 1996 04:00:00


On Wed, 11 Dec 1996 07:37:50 -0800, "Paul Clement"


>> > Right now it looks like I need to

>> > For x = 1 to 300000
>> >   MyTable.AddNew
>> >   MyTable("Field1") = value
>> >   MyTable("Field2") = value
>> >   MyTable("Field3") = value
>> >   MyTable("Field4") = value
>> >   MyTable("Field5") = value
>> >   MyTable.Update
>> > next x

> Place your code within a transaction (BeginTrans - CommitTrans). This will
> definitely speed up your updates and you won't see significant hard drive
> access until the CommitTrans statement is executed.

The only thing to watch out for this, according to my understanding,
is memory.  Transactions are supposed to buffer to memory, and when
you have this much stuff buffered, you may suffer disk paging/out of
memory errors.  Your mileage may vary, but if you have problems, all
you need to do is split it up into sections (ie. 1 to 50000 for
section 1, 500001 to 100000 for section 2, etc).

James

 
 
 

1. VB3.0 Data Access Question

I have to import about 300K number of records into an access database.  I had unloaded VB3.0 from my
machine and have recently reloaded it.

1) Wasn't there something I had to do to get VB3.0 to read/write ACCESS2.0?

2) I have programmed my VB application to create a database and table.  My question is what is the easiest
means to put these 300K records into the database?

Is there a speed hit if I chose table over dynaset?  This is a single user database.

Right now it looks like I need to

For x = 1 to 300000
  MyTable.AddNew
  MyTable("Field1") = value
  MyTable("Field2") = value
  MyTable("Field3") = value
  MyTable("Field4") = value
  MyTable("Field5") = value
  MyTable.Update
next x

This would appear to be harddrive intensive and I was hoping for a more efficient method.

Sorry if this is in the wrong news group but I know what ..vb.database.odbc is and don't know what DAO or
RDO are so was not sure the appropriate group to post..

2. VERY SIMPLE QUESTION ABOUT A VIEW

3. question reg. MS-Access database access using VB3

4. Passing table field rows to an ABF frame

5. VB3 (yes, VB3!) database question

6. Help With Delphi and Informix Please

7. Atlanta Progress positions, V8,

8. VB3.0 / Access 2.0 OLE Question

9. VB3/Access 2.0 Stupid Beginner Question

10. HELP: ODBC with Access 2.0, VB3.0, and Data Control

11. Accessing oracle7 Long data type with VB3