update table SQL vs Recordset

T

tim johnson

I have given below a way to add records to a table.
Is there any performance issues that would make this
method more or less efficient that using SQL statements
in an Update query?


Dim rst As ADODB.Recordset
Dim cnn As ADODB.Connection
Dim strSLQ As String

Set rst = New ADODB.Recordset
Set cnn = CurrentProject.Connection
Dim strSQL As String

'procedure to auto update auxillary accounts

strSQL = "SELECT AuxillaryID, Comments, TransDate,
Debit FROM tblAuxillaryDetails"

rst.Open strSQL, cnn, adOpenKeyset, adLockOptimistic,
adCmdText

rst.AddNew
rst!AuxillaryID = Forms!frmTrans!frmTransSubSub!
AuxillaryID
rst!Comments = Forms!frmTrans!frmTransSubSub!
AuxillaryComments
rst!TransDate = Forms!frmTrans!DatePaid
rst!Debit = Forms!frmTrans!frmTransSubSub!Debit
rst.Update
rst.Close
 
T

TomT

A pass-through query would be quite fast, since it only
runs on your SQL server, without any processing on the
Access side except to send it over to your SQL server.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top