Topic
  • 8 replies
  • Latest Post - ‏2013-10-18T04:24:50Z by CQAdmin
MatL
MatL
14 Posts

Pinned topic Cannot view debug statements in dbwin32

‏2013-09-26T18:18:38Z |

Hello,

I am trying to debug a VBScript to populate a control, however the output statements don't show up to help me determine how far I'm getting. All I see in dbwin32 is:

5112: *** Started OAdSession 4A35C20

5112: *** Deactivating inactive OAdSession 4A35C20

5112: *** Finished OAdSession 4A35C20

Goals:

1. Determine if the script is even being entered.

2. If the script is entered, determine why the query does not return any existing value(s).

Script:

Sub recordimpactedtransducer_ChoiceList(fieldname, choices)
  ' fieldname As String
  ' choices As Object
  ' record type name is ProductDefect
  ' field name is RecordImpactedTransducer
   
   Dim Session
   Dim ProjectRecord
   Dim QueryDefObj
   Dim FilterObj
   Dim ResultSetObj
   Dim ProjectValue, ProductValue
   Dim TransducerChoices
   Dim Status

   Set Session =   CreateObject("CLEARQUEST.SESSION")
   session.UserLogon "admin", "", "UltrasoundIMS", AD_PRIVATE_SESSION, ""

   Session.OutputDebugString(" Getting Project and Product values.  ")
   ProjectValue = Trim (GetFieldNameValue("Project").GetValue())
   ProductValue = Trim (GetFieldNameValue("Product").GetValue())

   Session.OutputDebugString(" Done getting values.  ")

   Set QueryDef = Session.BuildQuery("FindTransducer")
   QueryDef.BuildField ("project")
   QueryDef.BuildField ("product")
   QueryDef.BuildField ("impactedtransducers")

   Session.OutputDebugString(" Done with BuildQuery.  ")

   Set filterNode1 = QueryDef.BuildFilterOperator (AD_BOOL_OP_AND)
   filterNode1.BuildFilter "project", AD_COMP_OP_EQ, ProjectValue
   filterNode1.BuildFilter "product", AD_COMP_OP_EQ, ProductValue

   Session.OutputDebugString(" Done defining BuildFilters.  ")

   Set ResultSetObj = session.BuildResultSet(QueryDef)
   ResultSetObj.Execute
   Session.OutputDebugString("DEBUG - Filling the Tranducer Choicelist" & vbCrLf)

   While (ResultSetObj.MoveNext() = AD_SUCCESS)

       Session.OutputDebugString(" Entered While loop.  ")
    TransducerChoices.AddItem(ResultSetObj.GetColumnValue(3))
 
   Wend
   
   Status = ResultSetObj.MoveNext()

   Session.OutputDebugString("DEBUG - Tranducer Choicelist has been filled" & vbCrLf)

   Set ResultSetObj = Nothing
   Set FilterObj = Nothing
   Set QueryDef = Nothing
   Set Session = Nothing
   Set filterNode1 = Nothing
   Set TransducerChoices = Nothing
   Set Status = Nothing


End Sub

 

Environment

CQ 7.1.2.6, CQWeb

 

Thank you,

Matt

Attachments

  • CQAdmin
    CQAdmin
    103 Posts
    ACCEPTED ANSWER

    Re: Cannot view debug statements in dbwin32

    ‏2013-09-27T08:24:00Z  

    Yes, Session.OutputDebugString works in the way use are using.

    Can you please login as admin to the designer and remove or comment the below line-

      session.UserLogon "admin", "All-Issues", "UltrasoundIMS", AD_PRIVATE_SESSION, ""

    and then open DBwin32, now perform a test work..

    see if it works?

  • CQAdmin
    CQAdmin
    103 Posts

    Re: Cannot view debug statements in dbwin32

    ‏2013-09-27T08:10:07Z  

    Hello,

    I am not sure if we can use the Session.OutputDebugString in this way-

    Session.OutputDebugString(" Getting Project and Product values.  ")

    As per the below note-

    http://publib.boulder.ibm.com/infocenter/cqhelp/v7r0m1/index.jsp?topic=/com.ibm.rational.clearquest.apiref.doc/r_session_outputdebugstrng.htm

    Syntax should be -

    set sessionObj = GetSession 
    sessionObj.OutputDebugString "This is a test message."
    

    Thanks.

     

     

  • CQAdmin
    CQAdmin
    103 Posts

    Re: Cannot view debug statements in dbwin32

    ‏2013-09-27T08:24:00Z  

    Yes, Session.OutputDebugString works in the way use are using.

    Can you please login as admin to the designer and remove or comment the below line-

      session.UserLogon "admin", "All-Issues", "UltrasoundIMS", AD_PRIVATE_SESSION, ""

    and then open DBwin32, now perform a test work..

    see if it works?

  • CQAdmin
    CQAdmin
    103 Posts

    Re: Cannot view debug statements in dbwin32

    ‏2013-09-27T08:26:20Z  

    http://pic.dhe.ibm.com/infocenter/cqhelp/v8r0m0/index.jsp?topic=%2Fcom.ibm.rational.clearquest.apiref.doc%2Ftopics%2Fr_session_userlogon.htm

    session.UserLogon:

    If you are writing hook code, this method is typically not needed. IBM® Rational® ClearQuest® creates the Session object for you, and logs the user in before calling any hooks.

     

  • CQAdmin
    CQAdmin
    103 Posts

    Re: Cannot view debug statements in dbwin32

    ‏2013-09-27T08:29:03Z  

    Just curious to know - why are you using CQ web to test this?

    As per my understanding-

    You should have a TEST database associated with your schema. And when you are running DBWin32, you should run CQ Windows Client to see the changes.

    Thanks.

  • MatL
    MatL
    14 Posts

    Re: Cannot view debug statements in dbwin32

    ‏2013-09-27T21:07:05Z  
    • CQAdmin
    • ‏2013-09-27T08:24:00Z

    Yes, Session.OutputDebugString works in the way use are using.

    Can you please login as admin to the designer and remove or comment the below line-

      session.UserLogon "admin", "All-Issues", "UltrasoundIMS", AD_PRIVATE_SESSION, ""

    and then open DBwin32, now perform a test work..

    see if it works?

    Thank you very much. I'm proceeding with testing the work now.

    I will post to a separate thread if I have additional problems.

    I'm not testing in CQWeb. I just posted that to display the failure I was getting in my Production environment in case it helped to indicate a problem in the script.

    Best regards.

  • CQAdmin
    CQAdmin
    103 Posts

    Re: Cannot view debug statements in dbwin32

    ‏2013-10-01T03:51:12Z  
    • MatL
    • ‏2013-09-27T21:07:05Z

    Thank you very much. I'm proceeding with testing the work now.

    I will post to a separate thread if I have additional problems.

    I'm not testing in CQWeb. I just posted that to display the failure I was getting in my Production environment in case it helped to indicate a problem in the script.

    Best regards.

    You are welcome

    :-)

  • MikeCalm
    MikeCalm
    2 Posts

    Re: Cannot view debug statements in dbwin32

    ‏2013-10-14T10:45:37Z  

    You may need to give the Windows user you are using Windows "Debug programs" privilege, take a look at

    http://answers.microsoft.com/en-us/windows/forum/windows_vista-security/how-to-add-debug-programs-privilege-to-my/2a53387a-0ef5-436c-9266-ab1b60a1bb5f

    Hope it helps!

  • CQAdmin
    CQAdmin
    103 Posts

    Re: Cannot view debug statements in dbwin32

    ‏2013-10-18T04:24:50Z  
    • MikeCalm
    • ‏2013-10-14T10:45:37Z

    You may need to give the Windows user you are using Windows "Debug programs" privilege, take a look at

    http://answers.microsoft.com/en-us/windows/forum/windows_vista-security/how-to-add-debug-programs-privilege-to-my/2a53387a-0ef5-436c-9266-ab1b60a1bb5f

    Hope it helps!

    Hi MikeCalm,

    The issue has been resolved by removing one line from the code.

    Thanks.