Hello!<BR>I can&#039;t get value of variable that is passed by reference from method <BR><BR>in COM component to ASP script. Here is description:<BR><BR>I created COM component &#039;HelpDesk&#039; which includes Class &#039;CUser&#039; which <BR><BR>includes method &#039;AddUser&#039;. The method generates value for ID and <BR><BR>returns some message value. It has following parameters:<BR><BR><BR>Public Function AddUser(byRef ID As Long, byVal Username As String...) <BR><BR>As Long<BR>...<BR>ID = ...<BR>AddUser = ...<BR>End Function<BR><BR>When I created Test Form in VB, everything was fine. For example,<BR><BR>Dim myID As Long<BR>Dim obj<BR>Set obj=CreateObject("HelpDesk.CUser")<BR>Dim result As Long<BR>result = obj.Add(myID, &#039;xxxxx&#039; ...)<BR>MsgBox result & "," & myID<BR>...<BR><BR><BR>I get right value both for AddUser and for ID. BUT...!<BR>In ASP I used code like this:<BR><BR>...<BR>Dim objUser<BR>Dim RC<BR>Dim myID<BR><BR>Set objUser=server.CreateObject("HelpDesk.CUser")<BR>< BR>RC = objUser.AddUser(Clng(myID), &#039;yyyy&#039;)<BR><BR>Response.Write "RC = " & RC & "<BR>UserID=" & myID<BR><BR><BR>I got the correct value of RC (that is, AddUser), but the myID <BR><BR>variable&#039;s value was 0 and it wasn&#039;t supposed to be, so I figured that <BR><BR>value of myID never really changed since declaration. Notice that I <BR><BR>used Clng function because without it, I got &#039;Type mismatch&#039; error. I <BR><BR>also tried in Response.write line using Clng(myID), but it was still <BR><BR>failure. Then I tried to assign that value to some temporary variable <BR><BR>and to print that variable, value was still zero.<BR><BR>When I Copy-Pasted method AddUser into ASP script and tried to reach <BR><BR>method from the same ASP script, it worked fine. The only thing I <BR><BR>changed was parameters data types (...As Long, ...As String) because of <BR><BR>VBS&#039;s unabillity to declare data types. <BR><BR>So I wondered, should I change the method in COM component and use the <BR><BR>Variant parameters in order to get this to work?<BR><BR>BREAKPOINT!<BR><BR>While I was finishing this letter I got mail from a friend that pointed <BR><BR>me to http://support.microsoft.com/support/kb/articles/Q197/9/56.asp<BR>and there was solution to my problem.<BR>INDEED, BYREF PARAMETERS IN METHOD SHOULD BE DECLARED AS VARIANT IN <BR><BR>METHOD! (BYVAL PARAMETERS CAN BE , BUT DON&#039;T HAVE TO)<BR><BR><BR>Hope this letter will help someone with same problems!<BR>