Execute or Open??

Results 1 to 2 of 2

Thread: Execute or Open??

  1. #1
    Join Date
    Dec 1969

    Default Execute or Open??

    To execute a SQL statement, I am using 2 methods stated below:<BR><BR>Assume "adoconn" is the ADODB.Connection and "RS" is declared a RecordSet.<BR><BR>SQL="select * from table"<BR>1) Set RS = adoconn.Execute(SQL)<BR>2) RS.Open SQL, adoconn<BR><BR>Both ways work. What are the differences between these two methods? thanks!<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Execute or Open??

    The Recordset returned by the Connection.Execute method is a serverside, read-only, forward-only Recordset. This cursor is very flexible for typical applications which scan the row of a cursor forward-only, but you can&#039;t use its RecordCount property to find the number of qualifying rows. For this, you would use the Recordset object&#039;s Open method to set up a static client-side cursor. I use the Execute method then use the GetRows method on the Recordset. This way I have an array on client-side to work with and can immediately close my Connection and Recordset objects.

Posting Permissions

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