ActiveX DLL Component testing/Debugging (passing collections in immediate window) 
Author Message
 ActiveX DLL Component testing/Debugging (passing collections in immediate window)

I have an ActiveX DLL component I made for my ASP website.  I'm trying
to debug it.  I did a Run/Start with full compile.  Then clicked on
pause (|| button, called Break).  Then went to the immediate window and
typed "set obj = new UserClass" (UserClass is a class module inside my
DLL component that I want to debug).  I can then sort of interact with
my methods/etc by doing things like "?" but since I'm doing
this in Visual Basic for ASP pages my arguements are all Variants.  In
particular collections (so I can pass them back and forth from the
ActiveX DLL to my ASP pages).  How do I pass a Collection in my
immediate window??  Below is an example of one of my methods in my
UsersClass class module.  So I do run, break, go to immediate window and
type "set obj = new UsersClass" (a class module in my project).  Then do
"? obj.UserAuth" (a method/function in UsersClass) and of course I get a
runtime error saying argument not optional, because I didn't pass the
vAuthInfo collection.  How do I do that?  How do I pass a collection of
variables inside the immediate window?  Below is the method... I need to
pass a Collection to it that holds "usersname" and "password" as a

Public Function UserAuth(ByVal vAuthInfo As Variant) As Variant
  Dim vResponse As New Collection
  Dim SQLString As String
  Dim DBConn As String
  DBConn = "filedsn=c:\filedsn.dsn;UID=ibbs;PWD=ibbs123;"
  SQLString = "SELECT [user].username, [user].password, [user].custnum,
[user].email FROM [user]"
  SQLString = SQLString & " WHERE [user].username = '" &
vAuthInfo("username") & "'"
  Set oDb = CreateObject("ADODB.Connection")
  oDb.Open DBConn
  Set oRs = oDb.Execute(SQLString)
  If Not oRs.EOF Then ' User exists
    vResponse.Add True, Key:="exists"
    vResponse.Add Trim(oRs.Fields("username")), "username"
    vResponse.Add Trim(oRs.Fields("password")), "password"
    vResponse.Add Trim(oRs.Fields("email")), "email"
    vResponse.Add Trim(oRs.Fields("custnum")), "custnum"
    If (Trim(oRs.Fields("password")) Like Trim(vAuthInfo("password")))
Then ' Correct password
      vResponse.Add True, Key:="passed"
      vResponse.Add False, Key:="passed"
    End If
    vResponse.Add False, Key:="exists"
  End If
  Set UserAuth = vResponse
End Function

Rick Di Lorenzo
Systems Administrator
MCP+Internet MCSE
JCI Corporation

Sat, 29 Sep 2001 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Can't Create ActiveX Component While running DLL in VB for debugging

2. Debug info to other than Immediate Window...

3. Debug Immediate window prompt

4. VB5 Immediate Window/Debug Output to File

5. Passing collection to ActiveX DLL

6. clearing the Immediate/Debug window ???

7. How do you clear the Immediate (Debug) Window ?

8. Passing an ASP DLL to a VB ActiveX component

9. Debug in VB ActiveX components in Excel

10. Debugging ActiveX EXE components??

11. Debugging ActiveX EXE Components.

12. Trouble Passing VB6 Collection Object to VB6 Component in MTS


Powered by phpBB® Forum Software