Why would you use the Recordset object over the Execute method of
getting data from your Sql database.
For example, I have the following:
Execute Method
*************** *************** *************** *************** ***
Set connectionToDat abase=Server.Cr eateObject("ADO DB.Connection")
connectionToDat abase.Connectio nTimeout = 60
connectionToDat abase.Open "DSN=Customer;u ser id=SA;password= "
Set RecordCollectio n=connectionToD atabase.Execute ("Select * from Customers")
*************** *************** *************** *************** ***
*************** *************** *************** *************** ***
Set connectionToDat abase=Server.Cr eateObject("ADO DB.Connection")
connectionToDat abase.Connectio nTimeout = 60
connectionToDat abase.Open "DSN=Customer;u ser id=SA;password= "
Set RecordCollectio n=Server.Create Object("ADODB.R ecordset")
recordCollectio n.Open "Select * from Customers",conn ectionToDatabas e
*************** *************** *************** *************** ***
They both seem to work about the same. Why is one better than the other?
In the Execute method you just do a connection and select in one statement.
In the Recordset method, you have to create the object and then do a
connect and select.
Thanks,
Tom