Replacing "*lsxodbc" with "*lsxlc"

I used to have a common routine in which I could pass back the ODBC resultset; the calling routines could then interrogate and extract the data (multiple rows) from the resultset.

I have a script A to which the sql selectionstatement is passed

count = src.Execute (selectionstatement, fldLstRecord)

If B calls A, what do I pass back to B to allow it to interrogate multiple rows?

Subject: replacing “*lsxodbc” with “*lsxlc”

What prevents you from returning the ResultSet from your function? And there loop through this set.

Subject: RE: replacing “*lsxodbc” with “*lsxlc”

If I understand this correctly, I can pass back the LCFieldList which is the result of the src.Fetch. I’m just confused about how to process this is if I have a multi-row result from the Fetch.

Subject: RE: replacing “*lsxodbc” with “*lsxlc”

Use the Fetch method of the LCConnection object in a loop:

Set g_rstData = New LCFieldList

lReturn = g_ConData.Execute(sSQL, g_rstData)

If lReturn > 0 Or lReturn = LCCOUNT_UNKNOWN Then

While g_conData.Fetch(g_rstData, 1) > 0

sLoader = g_rstData.Fields(0).Value(0)

Wend

End If

That’s some old code I had laying around. A better approach is to use LCField’s. It’s more effort to set up initially but it executes faster and the code is easier to understand.

A good guide to look at is the LEI 6 Redbook (http://www.redbooks.ibm.com/abstracts/sg246067.html?Open). You can also try to muddle your way through the Lotus Connectors reference. It’s accessible from the normal Domino Designer help, or you can open it directly from the Notes help folder on your hard drive.

Good luck. LC LSX is good stuff, but it’s way more difficult to get started with than it should be.