DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Jordan Guest

    Dynamic Object Creation... Possible?


    I'm trying to determine if it is possible to dynamically set an object. In
    other words, if I have a variable name (say MyCalx), is it possible to pass
    that to a subroutine and do a Set MyCalx as New Calendar. It seems to work
    when I do this, but cannot access any of the properties or functions using
    MyCalx. If I try something like MyCalx.getdate() it comes back with "object
    required".

    Any help on this would be greatly appreciated.

    Jordy

  2. #2
    Russell Jones Guest

    Re: Dynamic Object Creation... Possible?

    Use Set MyCalx = Server.CreateObject("<ProgID>") instead of
    Set MyCalx as New Calendar. You need the ProgID for the Calendar object.


    "Jordan" <jordys@mediaone.net> wrote in message
    news:3bc364fe$1@news.devx.com...
    >
    > I'm trying to determine if it is possible to dynamically set an object.

    In
    > other words, if I have a variable name (say MyCalx), is it possible to

    pass
    > that to a subroutine and do a Set MyCalx as New Calendar. It seems to

    work
    > when I do this, but cannot access any of the properties or functions using
    > MyCalx. If I try something like MyCalx.getdate() it comes back with

    "object
    > required".
    >
    > Any help on this would be greatly appreciated.
    >
    > Jordy




  3. #3
    venki Guest

    Re: Dynamic Object Creation... Possible?


    dear friend,

    try passing the mycalx object to an object variable in the called function.
    ie create an object within the called routine and then pass the mycalx object


    regards
    venki

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links