borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Open/Clode DB Using ADO in VB6)Next Topic (Access Database Merge) New Topic New Poll Post Reply
AndreaVB Forum : Database : DAO RecordSet
Poster Message
suryasatya
Level: Big Cheese

Registered: 08-08-2006
Posts: 20

icon DAO RecordSet

Hi All,

I'm using DAO recordset to insert records into my MS ACCESS database using VB6.

In my code, we are placing records into database using below code:

Dim oRecordset As Recordset
oRecordset.AddNew()

//Filling all fields(around 100) with data using below statement
//Is there any better way to improve this code
oRecordset.Fields("fieldname") = fielddata

oRecordset.update()
oRecordset.Close()

Actually, we are placing lakhs of data into DB using above code continusely and only one record is available at a time.

Can any one suggest any better way to do this task. Its taking so much time... This is urgent requirement!!!!Pls  help.

Thanks,
Surya

____________________________
surya satya

20-07-2007 at 01:22 PM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon Re: DAO RecordSet

Hi,
Your syntax is correct and only using Access it's probably about as good as you are going to get.

Some things you can do.
Dont keep closing the recordset between calls to "addnew" will help.
use updatebatch not update

Alternatively,
I would recommend using Text importing in access to bulk import the data, then use queries to mess around with it (formatting, etc.) - much much quicker

Hope this helps,
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

30-09-2007 at 07:27 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : DAO RecordSet
Previous Topic (Open/Clode DB Using ADO in VB6)Next Topic (Access Database Merge) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder