Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

How do print info to a webpage from this agent?



Here is a copy of my agent.  The user is going to submit two variables
(torig and tdest) to the agent and external database using
webquerysave.  The next page will display the results to the user.  So
here are my questions:

-Did I pass the variables correctly?
-Do I need to use an ODBCresultset to output my data to the web?
  (I have one in there but it is commented out as I was trying to work
around it, it uses a messegebox in notes)
- How and where do I use the Print statement.  It's supposed to go at
the end of all statements, but where would that be here?
-What type of document should I be outputting information to? Is there
any code or information that should be put into the document before
use?

I have been trying to figure this out for a very long time and
continue to hit dead ends, any help is appreciated. Please, even if
you could answer 1 of my questions. Thank you!

---AGENT-----
Sub Initialize
        Dim s As New NotesSession
        Dim doc As NotesDocument
        Set doc = s.DocumentContext
                
        torig = doc.GetItemValue(t_orig)
        tdest = doc.GetItemValue(t_dest)
        
        Set con = New ODBCConnection
        Set qry = New ODBCQuery
        'Set result = New ODBCResultSet
        Set qry.Connection = con
        'Set result.Query = qry
        con.ConnectTo("myodbc3-trans")
        
        qry.SQL = "SELECT DISTINCT torig, tdest, tlorig, tldest, transoption,
tlduration FROM Trans WHERE torig LIKE 't_orig' AND tdest LIKE
't_dest'"

        'If Not result.Execute Then
        '       Messagebox result.GetExtendedErrorMessage,, _
        '       result.GetErrorMessage
        '       Exit Sub
        'End If
  REM Display result set properties after Execute
        'Call DisplayResultSetProperties
        'msg = "O's and D's:" & Chr(10)
        
        'Do
        '       result.NextRow
        '       torig = result.GetValue("TORIG", torig)
        '       tdest = result.GetValue("TDEST", tdest)
        '       tlorig = result.GetValue("TLORIG", tlorig)
        '       tldest = result.GetValue("TLDEST", tldest)
        '       transoption = result.GetValue("TRANSOPTION", transoption)
        '       tlduration= result.GetValue("TLDURATION", tlduration)
        '       msg = msg & Chr(10) & torig & " " & tdest
        
        'Loop Until result.IsEndOfData
                
        'Messagebox msg,, "O's and D's"
        Print torig
        Print tdest
        Print tlorig
        Print tldest
        Print "[/results.html]"
 
 'REM Display result set properties after processing 
  'REM result set
        'Call DisplayResultSetProperties
        'result.Close(DB_CLOSE)

        con.Disconnect
End Sub

---old ODBCresultset---
Sub DisplayResultSetProperties
        If result.IsResultSetAvailable Then
                If result.NumRows = DB_ROWSUNKNOWN Then
                        rows$ = "Not determined yet"
                Else
                        rows$ = Cstr(result.NumRows)
                End If
                Messagebox _
                "NumColumns = " & result.NumColumns & Chr(10) & _
                "NumRows = " & rows$ & Chr(10) &  _
                "IsBeginOfData = " & result.IsBeginOfData & _
                Chr(10) & "IsEndOfData = " & result.IsEndOfData & _
                Chr(10) & "CurrentRow = " & result.CurrentRow,,  _
                "Result set properties"
        Else
                Messagebox "Result set not available",,  _
                "No result set"
        End If
        
End Sub



<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.