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

Please visit our partners

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
An Overview of ASP.NET
Connections, Commands, And Procedures
What is ASP?

Don't use ODBC for your database connections
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates

Quick Tips

Never Use CreateObject

What's the difference between CreateObject and Server.CreateObject? They seem like they should be interchangable, but using the wrong one can cause your ASP application to fall flat on it's face.

VBScript's CreateObject method creates instances of objects inside the scripting engine's context and not in the context of the currently executing ASP page. This works fine in a single user environment, but on a web server it not only prevents the object from gaining access to the ASP intrinsics or the values from the current page, it also bypasses the memory management and process isolation benefits you get automatically when you use Server.CreateObject.

When working with ASP files, we've yet to find any benefit (or any reason at all) to use VBScipt's CreateObject over the one available from the Server object. So make sure that every time you use CreateObject you use Server.CreateObject.

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