dbTalk Databases Forums  

access2007 performance - recordsource vs recordset

comp.databases.ms-access comp.databases.ms-access


Discuss access2007 performance - recordsource vs recordset in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Roger
 
Posts: n/a

Default access2007 performance - recordsource vs recordset - 06-09-2011 , 11:07 AM






qryPartsQuote is a linked table to a sql server 2005 view
running the select statement in the management studio takes less than
a second


the following is in a form's open event (using access2007)
originally the recordsource statement was used, but the timing shows a
3 sec hit to set the recordsource

yet when I add the two 'set ' statement, they take 1 sec and the
recordsource statement still takes 3 secs

strSql = "SELECT * FROM qryPartsQuote WHERE partsQuoteId =
278"
Debug.Print Time
Set rs = CurrentDb.OpenRecordset(strSql)
Set .Recordset = rs
Debug.Print Time
.RecordSource = strSql
Debug.Print Time

since the above demonstrates two ways of setting the recordsource
and since the 'set .recordset = rs' statement sets the form's
recordsource
is there a downside to using
Set rs = CurrentDb.OpenRecordset(strSql)
Set .Recordset = rs

instead of
.RecordSource = strSql

to set the recordsource ?

I wonder why one method is faster than the other ?

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.