Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server.CreateObject vs "New" object

Status
Not open for further replies.

BG12424

Programmer
Jun 4, 2002
717
US
I have a situation with existing code where a previous developer instantiated multiple instances of an object to be used in the web page. See code below

Code:
Set objRO = Server.CreateObject("SampleObj.ClassNameHere")
Set objRO1 = Server.CreateObject("SampleObj.ClassNameHere")
Set objAuth = Server.CreateObject("SampleObj.ClassNameHere")

Could this be accomplished in a better way by doing this instead? See below

Code:
Set objRO = Server.CreateObject("SampleObj.ClassNameHere")
Set rs1 = New objRO
Set rs2 = New objRO
Set rsAuth = New objRO

Please advise... Thanks


regards,
Brian
 
The Set rs1 = New objRO syntax is reserved for "late bound" objects, i.e. those created using the "class" statement.

See the documenation on the "class" statement for the lowdown.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top