I have some code that uses lsxlc to access a DB2 database.The code works fine when I am connected to the network where the database server resides.
However if I disconnect from that network or change the database name so it is not one that is cataloged on my local workstation, the Notes Client Crashes and creates an NSD log file.
Has anyone else experienced this error?
I am running Lotus Notes R7.0 HF277 June 21, 2006 on Windows XP with the DB2 9.5 client installed.
Below is the code that runs. The crash happens on the line which runs lcConn.Connect.
Static Function getLCConnection(db As NotesDatabase, doc As NotesDocument, errProc$) As LCConnection
Static dbReq As notesdatabase
Static docProj As NotesDocument
Static lcConn As LCConnection
Dim conname As String
Dim db2Installed%
Dim reconnectReqd%
On Error Goto errorhandler
reconnectReqd% = False
If lcConn Is Nothing Then
Dim lcs As New lcsession
' LIST ALL AVAILABLE LCLSX CONNECTORS
Call lcs.ListConnector(LCLIST_FIRST,conname)
If Ucase(conname) = "DB2" Then
db2Installed% = True
End If
While lcs.listconnector(LCLIST_NEXT,conname) And db2Installed% = False
If Ucase(conname) = "DB2" Then
db2Installed% = True
End If
Wend
'// DB2 drivers not installed?
If db2Installed% = False Then
On Error Goto errorhandler
Error 1000, "The DB2 Client Driver needs to be installed to connect to the requirements database."
Exit Function
End If
Set lcConn = New LCConnection("DB2")
reconnectReqd% = True
End If
On Error Goto errorhandler
If dbReq Is Nothing Then
Set dbReq = getReqDb(db)
reconnectReqd% = True
End If
If docProj Is Nothing Then
Set docProj = getProjectDoc( _
dbReq, doc.Project(0), _
doc.Release(0), _
True _ 'includeDB2ConFields%
)
reconnectReqd% = True
End If
If ( _
lcConn.Database <> docProj.DatabaseName(0) Or _
lcConn.Userid <> docProj.DatabaseUserid(0) ) Then
lcConn.Database = docProj.DatabaseName(0)
lcConn.Userid =docProj.DatabaseUserid(0)
lcConn.Password = docProj.DatabasePassword(0)
reconnectReqd% = True
Else
If Not gLcConn.GetPropertyBoolean(LCTOKEN_IS_CONNECTED) Then
reconnectReqd% = True
End If
End If
If reconnectReqd% = True Then
' try the connect
Print "Connecting to Rational Reqpro DB2 db: " & lcConn.Database
On Error Goto errorhandler
'// THE NEXT LINE CRASHES LOTUS NOTES WHEN
'// THE DB IS NOT CATALOGED OR REACHABLE
lcConn.Connect
Print "Connected"
End If
Set getLCConnection = lcConn
Exit Function
errorhandler:
Print "Connection failed with error " & Err & ": " & Error
Set getLCConnection = Nothing
errProc$ = "ODBCLibrary:getLCConnection"
Set getLCConnection = Nothing
Exit Function
End Function