PC Review


Reply
Thread Tools Rate Thread

update table SQL vs Recordset

 
 
tim johnson
Guest
Posts: n/a
 
      9th Nov 2003
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

 
Reply With Quote
 
 
 
 
Ken Snell
Guest
Posts: n/a
 
      9th Nov 2003
Update query likely will be a bit faster.
--
Ken Snell
<MS ACCESS MVP>

"tim johnson" <(E-Mail Removed)> wrote in message
news:055801c3a64d$0f9a5110$(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
TomT
Guest
Posts: n/a
 
      9th Nov 2003
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.

>-----Original Message-----
>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
>
>.
>

 
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
Update Table Using A Recordset =?Utf-8?B?TGVzbGll?= Microsoft Access VBA Modules 4 20th Apr 2007 12:10 AM
Update a table using a recordset Jonathan Snyder via AccessMonster.com Microsoft Access VBA Modules 2 27th Jun 2005 09:42 PM
Update a table using a recordset Jonathan Snyder via AccessMonster.com Microsoft Access VBA Modules 0 27th Jun 2005 09:30 PM
Update a table from a Recordset =?Utf-8?B?V0Q=?= Microsoft Access VBA Modules 1 4th May 2005 07:18 PM
Recordset to update table Dale Microsoft Access VBA Modules 1 13th Oct 2004 01:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:08 AM.