Selasa, 25 Oktober 2011

RE: [MS_AccessPros] rst.AddNew vs. sql Insert Into statement

 

Hi Connie

I would usually execute an INSERT statement for adding a single record, but
would use rst.AddNew when adding multiple records in a loop. I haven't done
definitive testing, but my gut feeling is that the overhead of opening a
Recordset is greater that a SQL insert, but that the advantage is reversed
for multiple records.

I would also use a Recordset for a single record involving a large number of
fields, because the construction of a SQL statement can get pretty messy.

Best wishes,
Graham

> From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of mrsgoudge
> Sent: Wednesday, 26 October 2011 07:11
> To: MS_Access_Professionals@yahoogroups.com
> Subject: [MS_AccessPros] rst.AddNew vs. sql Insert Into statement
>
>  
> John,
> In inserting new records do you recommend one way over the other? I don't
want something screwy like this happening again.
>
> thanks!
> Connie

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar