Home
Extended ECM
API, SDK, REST and Web Services
LAPI - Retrieving Error information in VB
Dan_Duffy
I'm attempting to retrieve error information from LAPI calls in Visual Basic. According to the docs I should be using LL_SessionStatusError. Here is what I'm trying:(all output values allocated with LL_ValueAlloc -- I left out those for simplicity)The following code is in a function I'm calling after an error. ' retrieve the full error information errStat = LL_SessionStatusError(sessID, _ status, _ msg, _ errMsg, _ apiErr)This call returns LL_OK, but now how do I get the information out of the values? I've tried the following: errStat = LL_ValueGetString(msg, buf, 255, strLen) If (errStat <> LL_OK) Then MsgBox "Catch22 - error retrieving error information" Exit Function End If If strLen > 0 Then strMsg = Mid(buf, 0, strLen) End IfThe call to LL_ValueGetString returns LL_OK, but the returned strLen is 0.
Find more posts tagged with
Comments
eLink User
Message from Karen Aiken via eLinkI had similar problems with VBScript in Access -- actually the GetStringfunction caused Access to die.I changed the LL_ValueAlloc(errMsg) to LL_ValueAlloc errMsg (no parantheses)-- the first case was setting the errMsg pointer to 0, rather than an actualvalue, which might account for your 0 length as well.. worth a shot anyway..thx, Karen-----Original Message-----From: eLink Discussion: Development Discussion[mailto:development@elinkkc.opentext.com]Sent: Wednesday, May 16, 2001 3:28 PMTo: eLink RecipientSubject: LAPI - Retrieving Error information in VBLAPI - Retrieving Error information in VBPosted by NationsUser1 on 05/16/2001 03:23 PMI'm attempting to retrieve error information from LAPI calls in VisualBasic. According to the docs I should be using LL_SessionStatusError. Hereis what I'm trying:(all output values allocated with LL_ValueAlloc -- I left out those forsimplicity)The following code is in a function I'm calling after an error. ' retrieve the full error information errStat = LL_SessionStatusError(sessID, _ status, _ msg, _ errMsg, _ apiErr)This call returns LL_OK, but now how do I get the information out of thevalues? I've tried the following: errStat = LL_ValueGetString(msg, buf, 255, strLen) If (errStat <> LL_OK) Then MsgBox "Catch22 - error retrieving error information" Exit Function End If If strLen > 0 Then strMsg = Mid(buf, 0, strLen) End IfThe call to LL_ValueGetString returns LL_OK, but the returned strLen is 0.[To reply to this thread, use your normal e-mail reply function.]============================================================Discussion: Development Discussion
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=786303&objAction=viewLivelink
Server:
https://knowledge.opentext.com/knowledge/livelink.exe
Dan_Duffy
Hi Karen,Thanks for replying. I am using the no-parenthesis version of LL_AllocValue. What I have found is that the code only fails on some errors. some LL calls return negative status codes, and when you have one of those, LL_SessionStatusError does not return any errors. "Normal" positive-value status codes work just fine.Have you tried working with any of the date values? That's the one that is killing me right now. Jim
eLink User
Message from Karen Aiken via eLinkHi Jim -- Sorry, nope, I've only worked with the user functions and text values..haven't hit any date values yet, nor any negative status codes, so I'm outof ideas too... thx, Karen-----Original Message-----From: eLink Discussion: Development Discussion[mailto:development@elinkkc.opentext.com]Sent: Thursday, May 17, 2001 10:36 AMTo: eLink RecipientSubject: Been there, done that, but thanksBeen there, done that, but thanksPosted by NationsUser1 on 05/17/2001 10:33 AMHi Karen,Thanks for replying. I am using the no-parenthesis version of LL_AllocValue.What I have found is that the code only fails on some errors. some LL callsreturn negative status codes, and when you have one of those,LL_SessionStatusError does not return any errors. "Normal" positive-valuestatus codes work just fine.Have you tried working with any of the date values? That's the one that iskilling me right now. Jim[To reply to this thread, use your normal e-mail reply function.]============================================================Topic: LAPI - Retrieving Error information in VB
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=2519832&objAction=viewDiscussion
: Development Discussion
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=786303&objAction=viewLivelink
Server:
https://knowledge.opentext.com/knowledge/livelink.exe
Richard_Boyne_(boyne_(Delete)_891609)
The function LL_SessionStatusError is useful for retrieving the error message text for an error that occurred while executing LAPI code in the Livelink Server.For example, when CreateObjectEx fails trying to create an object that already exists.If an error occurs while executing LAPI code on the client then LL_SessionStatusError will not be helpful. For its client side errors, LAPI tends to return negative numbers. These error codes are defined as Public Const values in the lapi.bas file. For example,Public Const LL_E_COULDNOTCONNECT = &H8001000Bwhich is returned when a LAPI requests cannot connect to the Livelink Server.As a group, the Value API functions(such as the Date functions) do not communicate with the Livelink Server. They manipulate the LLVALUE data type objects on the client. Errors returned by these functions will be negative.The client programming environment errors are discussed in the online Livelink SDK API Developer's Reference. Look for the sub-title,"C/C++ and Visual Basic Errors" under the "Overview" section.