Q
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
 connect.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

SearchWindowsServer

Search400

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury

SearchDataCenter

SearchContentManagement

Close