This is a multipart message in MIME format.
[ Picked text/plain from multipart/alternative ]
First problem. You can't use message box on a server script.

If you want output use print function not message box.

Try this sample

Event Options:
  Option Public
  Uselsx "*lsxodbc"
Sub Initialize
        Dim con As New ODBCConnection
        Dim qry As New ODBCQuery
        Dim res As New ODBCResultSet

        If (con.connectto("localsystem","user","password")) Then
                qry.sql ="select * from QIWS.QCUSTCDT"
                Set res.Query = qry
                Call Res.FirstRow
                Call con.disconnect
        End If
End Sub

Walter Scanlan
Advisory Software Engineer
Domino For iSeries Team Leader
Sent by:
09/24/2002 11:16 AM
Please respond to domino400

        Subject:        Cannot Connect to RDB from Notes Agent

This document expires on 12/23/2002

I have searched the archive and still have been stumped.

I went through the process of creating an entry in the RDB using

When I signon to our AS400 using my userid and password and go into sql
(STRSQL) I can do a "SET CONNECTION MYDSN" and I get a "Current connection
is to Relational Database MYDSN". Otherwise I connect.

I can create an ODBC connection on my local pc and run the agent fine

If I run a scheduled agent on the AS400 If tells me I cannot connect.

Below is a simple script that I wrote to just see if I could connect and I
could not.

Any Ideas of what I am failing to do would greatly be appreciated.


Bruce "Hoss" Collins


Option Public
Uselsx "*LSXODBC"


Const Username = "HOSS"
Const Password = "mypassword"


Sub Initialize
      Dim con As New ODBCConnection
      Dim UserName As String
      Dim Password As String
      Dim msg As String

      Messagebox "Using DSN " & DSN
      Messagebox "Call "
      Call con.connectTo(dsn, UserName, Password)
      If Not con.ConnectTo(dsn, UserName, Password) Then
            Messagebox "Not Conneted Using " & DSN
            Exit Sub
            Messagebox "Connected Using " & DSN
      End If

      tables = con.ListTables(dsn)
      msg = dsn & " contains the following _tables:" & Chr(10)
      For n% = Lbound(tables) To Ubound(tables)
            msg = msg & Chr(10) & tables(n%)
      Messagebox msg,, "Tables for " & dsn

End Sub

This is the Lotus Domino on the iSeries / AS400 (DOMINO400) mailing list
To post a message email:
To subscribe, unsubscribe, or change list options,
or email:
Before posting, please take a moment to review the archives

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.