I decided to take the Help Desk up on their offer, and created a new agent that runs the sample code provided in the LSX Examples db. To eliminate the possibility of coder error, all I did was change the database, username and password settings in the code. I ran the code, and it still generated the same error.
08/02/2004 01:44:55 PM Agent message: Error: [IBM][CLI Driver][DB2/SUN] SQL0031C File "C:\32CAE614\bnd\db2clish.bnd" could not be opened., Connector 'db2', Method -Catalog [Metadata]- (-31)
Heavy Sigh
As before, the code I'm trying to run is viewable by clicking on Read More below.
Option Public
Option Declare
Uselsx "*LSXLC"
%INCLUDE "lsconst.lss"
Sub Initialize
Dim session As New LCSession
Dim connect As New LCConnection ("order")
Dim cnt As Long
Dim conFldLst As New LCFieldList (1, LCFIELDF_TRUNC_DATA + LCFIELDF_TRUNC_PREC)
Dim conFld As New LCField (LCTYPE_TEXT, 1)
Dim field As New LCField (LCTYPE_TEXT, 1)
Dim wintitle As String
Dim result As String
Dim mb As Long
On Error Goto ErrorHandler
wintitle = "Catalog Example"
connect.ConnectorName = "db2"
REM this section assigns the appropriate properties to connect to DB2
connect.Database = "SOMEDB"
connect.Userid = "user"
connect.Password = "password"
REM connect to DB2
connect.Connect
REM now perform the catalog action - in this case for metadata
cnt = connect.Catalog(LCOBJECT_METADATA,conFldLst)
If (cnt = 0) Then
mb = MB_IconInformation + MB_OK
Messagebox "No metadata was found.", mb, wintitle
End
Else
REM fetch the results
cnt = connect.Fetch(conFldLst, 1, 1)
End If
REM now get each field and build a list using the variable called result
REM this list can get very large depending on how many tables this DB2 database has
Set field = conFldLst.GetField(1)
result = ""
While ((session.status = LCSUCCESS) And (cnt >0))
result = result + field.text(0) + ","
cnt = connect.Fetch(conFldLst, 1, 1)
Wend
Print "Here is the metadata: " & result, wintitle
End
ErrorHandler:
Dim Msg As String
Dim MsgCode As Long
Dim status As Integer
If session.status <> LCSUCCESS Then
status = session.GetStatus (result, msgcode, msg)
Else
result = "Error " & Err() & ": " & Error()
End If
Messagebox (result), mb, wintitle
End
End Sub