Search code examples
asp-classiccreateobject

What is the difference between declaring connection via object tag and Server.CreateObject


When using classic ASP, what is the difference between declaring connection via object tag:

<object RUNAT="Server" ID="cn" PROGID="ADODB.Connection"></object> 

and declaring the connection via the Server.CreateObject() call:

set cn = Server.CreateObject("ADODB.Connection")

Or is there any difference? Performance, memory, etc..


Solution

  • The object method should perform better, because the object is first created when you start using it.

    I found some articles, maybe they give you some insight:

    http://www.aspmessageboard.com/showthread.php?t=6775

    http://www.asp101.com/tips/index.asp?id=4