ASP 101 - Active Server Pages 101 - Web06
The Place ASP Developers Go!

Windows Technology Windows Technology
15 Seconds
ASP 101
ASP Wire
VB Forums
VB Wire
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an site
ASP 101 is an site
Internet News
Small Business
Personal Technology

Corporate Info
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash

 Top ASP 101 Stories Top ASP 101 Stories
Connections, Commands, And Procedures
What is ASP?
VBScript Classes: Part 1 of N

Utilize browser capabilities
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates

Quick Tips

(<OBJECT> vs. Server.CreateObject())

When creating a server object using a server component, you have a choice between two methods. The most common method is to use the CreateObject() method of the Server object, as shown in the following code: SET NextLink = Server.CreateObject("MSWC.NextLink"). While this method works fine, there is another way to create an object that is just a bit more resource friendly.

When you create an object using the Server.CreateObject() method, the object is created as soon as the method is called. Any threads, memory, or other resources are allocated at the point of instantiation, or creation. The syntax for creating an object using the <OBJECT> tag is shown in the following statement:

<OBJECT Runat="Server" ID="NextLink" ProgID="MSWC.NextLink"></OBJECT>

By using the HTML <OBJECT> tag with the Runat=Server attribute, you can create the object in a way that it is not actually created until the first method or property of the new object is referenced. While this may not seem like a lot of savings, when you are trying to design a system that can withstand 1,000,000 hits per day, every little bit helps.

Previous      Show All Tips      Next

If you have a tip you would like to submit, please send it to:

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback
The Network for Technology Professionals



Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers