DB Connection Question

Results 1 to 2 of 2

Thread: DB Connection Question

  1. #1
    Join Date
    Dec 1969

    Default DB Connection Question

    Hi,<BR><BR>I have a question to ask which I cant seem to find answered anywhere.<BR><BR>The question is, Are Connection objects nessecary?<BR><BR>The reason I ask is, say I have the following code:<BR><BR>...<BR><BR>Dim rstRecordset<BR>Dim strSQL<BR><BR>strSQL = "select * from table"<BR>Set rstRecordset = Server.CreateObject("ADODB.Recordset")<BR>rstRecor dset.Open strSQL, "DSN=myDSN"<BR><BR>....<BR><BR><BR>It is possible to open it that way instead of using a connection object.<BR><BR>I am wondering, is there any performance issuesin doing this, or is it exactly the same as creating a connection object, opening it, and then opening the recordset with that.<BR><BR>Any help would be greatly appreciated.<BR><BR>Regards,<BR>Aaron

  2. #2
    Join Date
    Dec 1969

    Default RE: DB Connection Question

    that&#039s a perfectly valid approach - but i don&#039t think the performance gain is significant. the downside with this approach is the connection is only available for one recordset operation, and would have to be re-created for the next recordset operation, instead of using the same connection (actually creating a connection is one of the most costly operations in terms of server resources)<BR><BR>the explicit approach offers better control rather than creating implicitly<BR><BR>j

Posting Permissions

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