Right, no lsxodbc, i had forgotten about the odbc connector for LCLSX. Our servers will soon be on Unix, so here is what we are going to try:
- Public Class Connection
- Public connection As LCConnection
- Private session As NotesSession
- Sub new
- Set Me.session = New NotesSession
- End Sub
- Public Sub initialize
- Select Case session.isonserver
- Case True
- Set Me.connection = New LCConnection("odbc2")
- Case False
- Set Me.connection = New LCConnection("oledb")
- End Select
- End Sub
- End Class
for script that runs locally (in our environment this is always Windows):
set connection = new connection
connection.initialize
with connection.connection
.provider = "sqloledb"
etc
end with
for script that runs on the server (which will be Unix pretty soon):
set connection = new connection
connection.initialize
with connection.connection
whatever properties are required for using the odbc connection - why are these not documented???????????
end with
With this arrangement we can write script that works with SQL Server and can be invoked at either the client or server.
You may be wondering why I don't instantiate the LCConnection right away in the constructor. I'm glad you asked. The answer is that under 6.5.5 for Windows, if you instantiate an LCConnection with the oledb argument, and never call .connect, Notes drag and drop stops working (that is, when the LCConnnection passes out of scope), and then it crashes. Therefor the Initialize method, to be called when we are sure we want to connect to something.


. . . . RE: Connect to either odbc -or- ole... (Thomas Kennedy 22.Mar.07) 