Sending Data to SQL Server

I’m trying to set 32 parameters when sending data to a SQL Server. I can’t use execProcedure (I use it to collect data from SQL Server though), as it has more than 30 parameters to set.

Set qry.connection = con

qry.SQL = “exec dbo.sp123_nameofprocedure ?@pIDNo?, ?@pDesc?, … (32 parameters)”

Set res.Query = qry

Call res.SetParameter(2, " & doc.IDNo & ") 'Number Value

Call res.SetParameter(3, " ’ " & doc.Desc & " ’ ") 'Text Vlaue

res.execute

** The above don’t set the data at all.

But when I do the following, it does.

qry.SQL = “exec dbo.sp123_nameofprocedure 123, ‘TestDescription’, … (32 parameters)”

Any ideas will be appreciated.

Thank you.

Subject: Sending Data to SQL Server

You can also use the Lotus Connector for ODBC. You may find it performs better than LSXODBC.

Subject: Sending Data to SQL Server

Why not change the second line qry.SQL = … as follows:

qry.SQL=“exec dbo.sp123_nameofprocedure 123, '” + doc.IDno(0) + “', '”+ doc.Desc(0) + “',…”

This means you will be setting the values directly into the qry-string from the document-items.

NB: you could for reasons of readability change all the "-characters into a |-character.