Problem solve Get help with specific problems with your technologies, process and projects.

Use LSX code to connect to SQL Server 2000

I'm running Domino 6.0.1 and SQL Server 2000 on my machine. I was able to connect to the SQL server using DECS, but DECS didn't give me the programmable power I required. I need to use LCX; but with LotusScript, I get the error message, "Instance member DATABASE does not exist," when I run this connection test code behind a button:
Dim connect As New 
LCConnection ("odbc2") 
' set the appropriate 
properties to connect to odbc2
' note the use of dynamic 
properties to do this
' all properties of a connection 
may be referenced
' by name
 connect.Database = "Northwind"
 connect.Userid = "user id here"
 connect.Password = "pwd here"
REM try the connect
 Print "Successfully connected
 to ODBC2."
End Sub

How can I successfully use LSX code to connect to SQL Server 2000?

Ah yes, the nuances of LC-LSX! The ODBC LCConnection Object uses the Server property to set the Data Source name. Try changing your code to: connect.Server = "Northwind."

It should connect.

I've been writing LC-LSX code since 1998, and I'm still not sure of all the correct properties for the various connectors. To see what the field names are for a particular connector, I look at the DECS or LEI connection form in Designer. Most often, the field names used on the Connection Document form have the same names as the properties used by the LC-LSX.

Do you have comments on this Ask the Expert question and response? Let us know.

Dig Deeper on LEI and DECS for Lotus Notes Domino



  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...