LCLSX agent connecting to SQL Server 2000 database does not work when scheduled

I have been creating Lotus Script agent that uses OLEDB-connector to SQL Server 2000 (sp3 and sp4) database running on Windows 2003. That agent works fine when running manually from Lotus Notes client but when I schedule it, the conncetion to that SQL server fails with error:

12325: Error:

ErrorRecord: HResult: 0x80004005

Description: [DBNMPNTW]Specified SQL server not found.

SQLErrorInfo: 08001

Source: Microsoft OLE DB Provider for SQL Server

, Connector ‘oledb’, Method -Connect- (12325) –

ErrorRecord: HResult: 0x80004005

Description: [DBNMPNTW]Specified SQL server not found.

I have tested this agent on two Domino servers and the same thing happens. But when I use this scheduled agent towards SQL Server 7 database residing on another server (windows NT) then it works.

I have installed also DECS on the server (where the scheduled agent does not work) and I can get a connection to that SQL Server with OLE provider. I have run also OLE connection test on that server and that is succesful too.

Have anyone of you idea what needs to be done to get this work?

Part of the conncetion code is like this (strProvider = SQLOLEDB):

Set lcCon=New LCConnection(“oledb”)

With lcCon 

	.Provider=strProvider

	.Server=strServer

	.Database=strDatabase

	.Metadata=strMetadata

	.Userid=strUserId

	.Password = strPassword

End With



lcCon.Connect 

I have used as a SQL server name both fully qualified name and IP addess but no help with that.

Regards,

Maija

Subject: LCLSX agent connecting to SQL Server 7 database does not work when scheduled

Are you sure the sql odbc drivers / settings are correct on the domino servers? Since its running on the domino server, the domino server needs connectivity to sql server.

Subject: RE: LCLSX agent connecting to SQL Server 7 database does not work when scheduled

Thanks Tom for your message. i have understood that when using OLE connector you do not have to define any ODBC data source definitions on the server. But actually I tried that one too - I have created also ODBC data source for that SQL Server and that did not help. But do you have an idea is some OLE connectors need to be installed on the Domino server? That is still strange because I have not installed anything on my client either and still that code works. And I can connect to another SQL server from that Domino server. Is it something wrong between SQL Server and Domino server communication? In the Domino server’s hosts file there is an IP address defined for that problematic SQL Server too.

Subject: LCLSX agent connecting to SQL Server 2000 database does not work when scheduled - SOLVED

It seems to be working now after some setting for TCP/IP definition on SQL Server server according to this document:

http://www.kbalertz.com/Q306865/Server.Listen.Sockets.Protocol.aspx