Thursday, January 17, 2013

List all ODBC Connections mapped with Lotus Notes using Lotusscript

A while ago I was given a very nice job of finding why a lotus script agent was not able to communicate with a DB2 server. And the nice stupid part about that is I never had acess to even view the log files of the server where the issue occurs. It was kind of frustrating for a while to understand/find the source of the issue with virtually no resources. It was that I was thinking about the most basic of the scenarios like, network problems, lan cable issues etc etc,

So eventually I just wanted to know if there is a way to list down the kind of connections that are prevalent with a lotus domino server and ended up discovering the following. Again I just discovered if for myself. It was always able on the innernet some how of the other.:)

The following code gives you a message box with something like,
 "The usable connections are file, notes, odbc2, oledb"

Atleast this is what I got. Evidently db2 was missing in the list for me and hurray, administrators found it at last that db2 was not mapped properly with the lotusdomino servers after looking at the proof . What ever that means. :P

Dim session As New LCSession
 Dim conName As String
 Dim text_str As String
' list the connectors available
' the parameters for connector code, identity flags, and
' identity names are optional and omitted in this example
 Call session.ListConnector(LCLIST_FIRST, conName)
 text_str = conName
 While session.ListConnector(LCLIST_NEXT, conName)
  text_str = text_str + ", " + conName
 Msgbox "The usable Connectors are " & text_str

No comments:

Post a Comment