[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Access SQL Server database from Lotus Notes using lsxlc

Posted on 2011-09-11
5
Medium Priority
?
2,161 Views
Last Modified: 2013-12-18
I am making a new app in Lotus Notes, it requires to access a MS SQL Server for accessing some data and past them in a Lotus Notes document.
I want to use lsxlc for this, but I can not make the logon to work, I get a 12325 error "Logon failed"
I think that the problem is in the name of the server or user name.    I have tried many options but with no sucess

Something wrong here?    Thanks

Uselsx "*lsxlc"
Sub Initialize
      Dim s As New NotesSession
      Dim uiw As New NotesUIWorkspace
      Dim db As NotesDatabase
      Dim LCses As LCSession
      Dim LCcon As LCConnection
      Dim LCfldLst As New LCFieldList
      Dim uid As NotesUIDocument
      Dim doc As NotesDocument
      Dim newDoc As NotesDocument
      
      On Error Goto errorHandler
      
      Set db = s.CurrentDatabase
      
      'get the query
      Set uid = uiw.CurrentDocument
      If uid.EditMode Then Call uid.Save
      Set doc = uid.Document
      qs$ = doc.QS(0)
      
      If qs$ = "" Then
            Messagebox "No Search Query Specified"
            Exit Sub            
      End If
      
      'connect to sql
      Set LCses = New LCSession
      Set LCcon = New LCConnection("OLEDB")      
      LCcon.Provider = "SQLOLEDB"
      'LCcon.Auth_Integrated = "SSPI"
      LCcon.Init_DataSource = "40-dbs" 'DataSource name
      LCcon.Database = "dbo.personal" 'Database name
      LCcon.Userid = "hector_herrera"
      LCcon.Password = "********"
      LCcon.Connect
      
      If Not LCcon.IsConnected Then
            Messagebox "Unable to connect to SQL."
            Exit Sub
      Else
            MessageBox "Worked !!!"
      End If
      
      SQL_Statement = qs$      
      result = LCcon.Execute ( SQL_Statement, LCfldlst )
      result = LCcon.Fetch ( LCfldlst, 1, 1 )
      
0
Comment
Question by:maqsacat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 36520073
Did you print the line the error occurred on, in the errorHandler code? Which line causes the error?

Write something like the next line:
      Print Error¤ "on line " Erl
0
 

Author Comment

by:maqsacat
ID: 36520566
Yes, see attached file.    I did try changing the user name two times.    Also included you can see the SQL Server administrator with the database name and tables
Line 37 is Lccon.connect two diferent errors and sql server manager
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 2000 total points
ID: 36522430
0
 

Author Comment

by:maqsacat
ID: 36537236
I made the changes and is working fine now...  
Thanks!
0
 

Author Closing Comment

by:maqsacat
ID: 36537245
Changes made and working fine
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question