Significance of ADODB.Recordset?

Results 1 to 2 of 2

Thread: Significance of ADODB.Recordset?

  1. #1
    Join Date
    Dec 1969

    Default Significance of ADODB.Recordset?

    Hi,<BR><BR>I&#039;ve seen code where some people use the lines below when they are opening a recordset:<BR><BR>Set rs = Server.CreateObject("ADODB.Recordset")<BR>rs.Open "TblAnnoucements", objConn ,adOpenDynamic, adLockOptimistic, adCmdTable<BR><BR>But I&#039;ve also noticed some code where the above two have been excluded and only the below line is used to access a recordset:<BR><BR>set rs = objConn.Execute("SELECT * FROM TblAnnouncements")<BR><BR>What benefits do the first two lines present? Is it better to include the first two lines, or does it matter? Thanks.

  2. #2
    Join Date
    Dec 1969

    Default Pros and cons...

    The SET RS= form is (a) easier to type, (b) a little bit faster, and (c) produces a faster-to-use recordset.<BR><BR>*BUT*<BR><BR>But you then *always* get an adOpenForwardOnly cursor (so you can&#039;t get a RecordCount, use MovePrevious or MoveAbsolute, etc.) and an adLockReadOnly lock type (so you can&#039;t alter that recordset).<BR><BR>In short, if you can live with the limitations of the SET RS= form, use it. If you can&#039;t, move to the other form.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts