Q

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.

This was first published in June 2004

Dig deeper on LEI and DECS for Lotus Notes Domino

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

Search400

  • 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 ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close