Results 1 to 3 of 3

Thread: Help Help Calling Subs in ASP

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    15

    Help Help Calling Subs in ASP

    I can't seem to find any info on this anywhere on the net. I know it's prolly real basic but I'm new at thisl.

    Say I have a sub procedure in VB6.0 that creates a new entry in a database...

    Public Sub Create(RefNum as Long, Name as String)

    How do I call it and use it? I tried...

    oObj.Create (200,"Joe") but the error says "Cannot use parentheses when calling a Sub".

    Thanks in advance

  2. #2
    Lively Member
    Join Date
    Aug 2002
    Posts
    126
    i can give three options:
    1. u can still use parenthesis, but just add "call" before the method: call oObj.Create (200,"Joe")
    2. get rid of the parenthesis, just type: oObj.Create 200,"Joe"
    3. replace the sub to function and then u can use the original statement

  3. #3
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    I take it your sub procedure is in a vb6 written Dll file?
    If so, make sure the sub procedure is declared publically and the class module it's contained in has it's instancing property set to multiuse.

    You can then call on the code like this:
    Server.Createobject("mydllprojectname.mydllclassname")

    http://www.vbforums.com/showthread.p...ht=dll+and+asp

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width