PC Review


Reply
 
 
Wayne Gibson
Guest
Posts: n/a
 
      23rd Nov 2005
Hi,
Was wondering if anybody could help.

I'm looking to add a lots of records to an access database, but it looks
like I'm going to have to insert them one at a time!!!
Looks like I'm going to have to do this for each new record..

Insert into Database(<fields>) VALUES(<values>)

Was wondering if there was anything similar to the MySQL Implementation
where I can add several new rows in one SQL command.

Many thanks

Wayne


 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      23rd Nov 2005
You could use: DataAdapter.FillSchema() to create a mapped DataTable that
looks like the original, but has no data in it. You could then populate
that table with your new data and then just use: DataAdapter.Update().


"Wayne Gibson" <(E-Mail Removed)> wrote in message
news:dm1sjm$prs$1$(E-Mail Removed)...
> Hi,
> Was wondering if anybody could help.
>
> I'm looking to add a lots of records to an access database, but it looks
> like I'm going to have to insert them one at a time!!!
> Looks like I'm going to have to do this for each new record..
>
> Insert into Database(<fields>) VALUES(<values>)
>
> Was wondering if there was anything similar to the MySQL Implementation
> where I can add several new rows in one SQL command.
>
> Many thanks
>
> Wayne
>



 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      23rd Nov 2005
Wayne,

You can use Scotts solution, however be aware, they will forever inserted
one in a time.

A dataadapter uses the same commands as you do.

Just a little addition.

Cor

"Wayne Gibson" <(E-Mail Removed)> schreef in bericht
news:dm1sjm$prs$1$(E-Mail Removed)...
> Hi,
> Was wondering if anybody could help.
>
> I'm looking to add a lots of records to an access database, but it looks
> like I'm going to have to insert them one at a time!!!
> Looks like I'm going to have to do this for each new record..
>
> Insert into Database(<fields>) VALUES(<values>)
>
> Was wondering if there was anything similar to the MySQL Implementation
> where I can add several new rows in one SQL command.
>
> Many thanks
>
> Wayne
>



 
Reply With Quote
 
Wayne Gibson
Guest
Posts: n/a
 
      23rd Nov 2005
Thanks for replying..

But surely this is just doing multi insert intos?

The MySQL version of insert into works like this...

INSERT INTO table (col1, col2, col3)
VALUES
('val1','val2','val3'),
('val1','val2','val3'),
('val1','val2','val3');

I know that when I converted from executing individual insert into to this
insert into on a MySQL it was a great improvement..

The problem is that I have about 55000 inserts to do and I wanted a quick
way to do it..
Any other ideas?

Thanks

Wayne


 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      23rd Nov 2005
Wayne,

I think that you are after this,

Bulkinsert.
http://msdn.microsoft.com/library/de...ba-bz_4fec.asp

However this is SQLserver 2005, I don't believe it exist on Access.

In this page are links to deeper explanation of Access and SQL
http://msdn.microsoft.com/library/de.../acfundsql.asp

I hope this helps,

Cor


 
Reply With Quote
 
Jim Hughes
Guest
Posts: n/a
 
      23rd Nov 2005

"Wayne Gibson" <(E-Mail Removed)> wrote in message
news:dm1sjm$prs$1$(E-Mail Removed)...
> Hi,
> Was wondering if anybody could help.
>
> I'm looking to add a lots of records to an access database, but it looks
> like I'm going to have to insert them one at a time!!!
> Looks like I'm going to have to do this for each new record..
>
> Insert into Database(<fields>) VALUES(<values>)
>
> Was wondering if there was anything similar to the MySQL Implementation
> where I can add several new rows in one SQL command.
>


You still need to do it one record a time, but you could use an Access
Stored Proc as shown in the article at
http://www.devcity.net/Articles/18/msaccess_sp.aspx

The only real advantage would be in not having to send the <fields> list
over each time.


 
Reply With Quote
 
Luxspes [MCP]
Guest
Posts: n/a
 
      24th Nov 2005
Cor Ligthert [MVP] wrote:
> Wayne,
>
> I think that you are after this,
>
> Bulkinsert.
> http://msdn.microsoft.com/library/de...ba-bz_4fec.asp


Be careful when using it, because you have to specify that any
constraints on table_name are checked during the bulk copy operation. By
default, constraints are ignored.
>
> However this is SQLserver 2005, I don't believe it exist on Access.
>
> In this page are links to deeper explanation of Access and SQL
> http://msdn.microsoft.com/library/de.../acfundsql.asp
>
> I hope this helps,
>
> Cor
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't open my Access files after conversion from Access 97 to Access 2003 M Shafaat Microsoft Access 5 10th Apr 2010 09:04 PM
Saving Access 2007 database in Access 2003 format fails in Access =?Utf-8?B?U3Bpcm8=?= Microsoft Access External Data 0 13th Aug 2006 08:37 AM
W2K3 Service w/ UNC Access, Local Disk Access, and DB Access Rob Microsoft C# .NET 6 2nd Aug 2004 01:44 PM
Access "showing images on first page only of very wide Access report. Windows XP, Access XP Jack Microsoft Access Reports 4 18th Nov 2003 03:01 PM
Re: Allowing users (w/o MS Access) to access an Access 2000 database Wayne Morgan Microsoft Access 0 29th Sep 2003 11:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:37 PM.