Urgent! Problem accessing SQL database in LS

I have upgraded a Domino server from 7.03 to 8.5. The 7.03 Domino server was running on Windows server 2003, the 8.5 Domino server is 32 bit and is running on Windows 2008 server 64 bit.In a Notes application I have an Lotus Script agent which has to write records into a SQL database on a SQL server. On the Windows server where Domino is running I created a ODBC (system DSN) datasource to communicate with the SQL database.

The agent is scheduled to run on the server. with runtime security level 3.

On Windows 2003 with Domino 7.03 everything went fine.

Now the agent cannot create the ODBC connection

Dim con As New ODBCConnection 'Make ODBC Connection

If Not con.ConnectTo("prices","user","password") Then

	Print "Could not connect to prijslijsten"

	Exit Sub

End If

I let things writing to a Notes Agent log and this says:

An Error LS:DO- ODBC could not complete the requested operation.( 720) has occurred on line 42 in ExportAgent

Line 42 is this line: If Not con.ConnectTo(“prices”,“user”,“password”) Then

When I run the agent not scheduled but On Event, Agent Menu Selection from the Notes database, the agent is running fine.

The ODBC Datasource should be ok for when I test the connection it is succesfull.

I am afraid that this has to do with the way Domino as service is running on Windows 2008 server.

Domino running as an application is not an option because my antivirus program will only work when Domino is running as a service.

Has anyone an idea how to solve this.

Subject: ODBC source

Is your ODBC source registered as a System ODBC source on the Domino server ?Anyway I recommend to use ADO (OLE DB) instead of ODBC for connecting to SQL Server. Performance is much better and no connection to set up.

Thierry Cayla

http://dominoeffects.serveblog.net

Subject: ODBC

Thanks for your reply. Yes, it is a System DSN.I never worked with OLE DB. Any documentation?

The problem is: it is a live application which was running on Domino 7.0.3 on a Ms Windows 2003 server. We replaced that server by a new one (2008 server) with Domino 8.5 and now I can’t connect anymore with my SQL server.

Subject: ADO/OLE DB

Plenty of documentation available on Microsoft’s sites.LS code to connect is similar to VB.

No need to set up a data source, the connection stuff (dlls, etc.) are in the Windows server OS since W2003.

You just need the proper ADO connection string (google for it, plenty of reference everywhere).

Thierry Cayla

http://dominoeffects.serveblog.net