ASP Question - Why can't I pass a function parameter by name? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


ASP Question - Why can't I pass a function parameter by name?


I have developed a server side DLL to create disconnected recordsets for an ASP application. In this DLL I have created a class for each of my SQL database tables. For each class I have created a LIST, ADD, EDIT, and DELETE method. The arguments for these methods are Optional. I made these arguments optional so that I do not necessarily have to pass data to the class method when I want to return results. My problem:

I have done all of this planning to make this simple middle tier data access method, but ASP does not seem to allow me to explicitly name arguments in Object methods.

------------- Example --------------
I have a method(ADD) of a class(USER) in the DLL:

Public Function Add(us_user_id, Optional us_username, Optional us_password) As Long

Then in the ASP page I instantiate the object and call the method:
lngResult = objUser.Add(intUserID,strUsername,strPassword)

-----Does not work
lngResult = objUser.Add(us_user_id:= intUserID, us_username:= strUsername, us_password:= strPassword)


Anyone have any idea why this does not work in ASP? Is it just not supported? Any help would be greatly appreciated.



Sign In or Register to comment.