update table SQL vs Recordset

  • Thread starter Thread starter tim johnson
  • Start date Start date
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
 
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.
 
Back
Top