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.




  • Shawn CarterShawn Carter Member Posts: 0

    ________ [ ] free ebooks and video tutorials about \ Scratch, Ruby, C++, Go, C, Python, Swift, PHP, Delphi, Perl, Visual Basic .NET, PL/SQL, JavaScript, R, Visual Basic, Java, C#, Assembly, MATLAB, Objective-C Ada, ML, Logo, Bash, Alice, D, ABAP, Transact-SQL, LabVIEW, Prolog, Lisp, Erlang, Crystal, Lua, Hack, Apex, COBOL, Julia, Scheme, SAS, Kotlin, F#, Scala, Awk, Rust, FoxPro, VBScript, Fortran, Clojure, Dart \ ______

Sign In or Register to comment.