Re: Fastest record create method with JET 4.0



Basically, all my application does with the Access database is connect,
open
the table, add a record, fill in the field values, save the record, close
the
table and disconnect. (I actually add lots of records in each table open
/
connection, but that isn't the point.)

Actually it is the point.
What I do directly depends on the number of records being inserted.
Amazing that you dismiss that.

If you adding a few records or 1-at-a-time (slowest) then a Connection
Execute is best with "INSERT INTO yourtable VALUES ( ...)". That is faster
than constructing a Recordset.

If you adding a many records then I can think of 3 approaches which never
having timed with Access I would have to check

(i) Using an Access query and calling it via a persistent Command object
with parameters (so SP approach)
(ii) Using a adhoc SQL INSERT statement with a persistent Command object
with parameters (so temporary SP approach).
With both above be sure to do "SET NOCOUNT ON" and call the Command object
with options set saying there is no Recordset returned.
(iii) Using a client-sided Recordset with UpdateBatch and a SQL command like
"SELECT fld1,fld2,fld3... FROM yourtable WHERE 1=2". You get an empty
Recordset which you can do many AddNew's and finally UpdateBatch.

Last I checked, what you cannot do with Access is present multiple
statements at once unlike SQL Server.

Stephen Howe


.



Relevant Pages

  • Re: Command Oject to pass parameters and CursorLocation
    ... recieved any results in my recordset. ... The Cursor location for RecordSet returned is whatever the current Cursor ... Location of the underlying Connection for Command object is set to. ... DO NOT set Connection. ...
    (microsoft.public.data.ado)
  • Re: Command Oject to pass parameters and CursorLocation
    ... recieved any results in my recordset. ... The Cursor location for RecordSet returned is whatever the current Cursor ... Location of the underlying Connection for Command object is set to. ... DO NOT set Connection. ...
    (microsoft.public.data.ado)
  • Re: Command Oject to pass parameters and CursorLocation
    ... recieved any results in my recordset. ... The Cursor location for RecordSet returned is whatever the current Cursor ... Location of the underlying Connection for Command object is set to. ... DO NOT set Connection. ...
    (microsoft.public.data.ado)
  • Re: reusing command object
    ... the recordset and make updates to certain records. ... Dim cmd As New ADODB.Command ... Dim rst As ADODB.Recordset ... command object as its connection parameter. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: HELP! Error on Stored Procedure - AbsolutePage Property
    ... > "Current Recordset does not support bookmarks. ... > 'Connect command object to database (as I understand how you said to do ... SQL Server is a very capable provider, ... Of course all of this assumes the underlying SQL (in the stored procedure) ...
    (microsoft.public.vb.database.ado)