× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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

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


Walter Scanlan
Advisory Software Engineer
Domino For iSeries Team Leader
Internet  WSCANLAN@US.IBM.COM
507-286-6088
www-3.ibm.com/software/lotus/support/





bacollins@verinettech.com
Sent by: domino400-admin@midrange.com
09/24/2002 11:16 AM
Please respond to domino400

        To:     domino400@midrange.com
        cc:
        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
ADDRDBDIRE
RDB(MYDSN) RMTLOCNAME(*LOCAL)

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
locally.

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.

Thanks

Bruce "Hoss" Collins


(Options)

Option Public
Uselsx "*LSXODBC"

(Declartions)

Const DSN="MYDSN"
Const Username = "HOSS"
Const Password = "mypassword"

(Initialization)

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
      Else
            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%)
      Next
      Messagebox msg,, "Tables for " & dsn
      con.Disconnect

End Sub




_______________________________________________
This is the Lotus Domino on the iSeries / AS400 (DOMINO400) mailing list
To post a message email: DOMINO400@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/domino400
or email: DOMINO400-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/domino400.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 by midrange.com 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.