Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 using LL APIs (RecArray row count) 1

Status
Not open for further replies.

Alleyopp

Programmer
Sep 17, 2004
22
US
I am using the LL APIs for VB6.
I used a ListObject that returned a recarray of folders.

How do I get the count of how many rows are in the recarray?

I could go up a directory level do a ListObject and get the childcount but that seems like a hard way when I have the recarray already...

Is there a BOF/EOF or a .recordcount or a MaxIndex property?? I dont see anything in the documentation...

Any Help would be really really appreciated.
Alley
 
You have to read up on the lapi documentation.However sensing that your need is urgent i serache din the OT knowledge base and found a VB sample.Hope you will try to understand it before emabarking on what it does.only relevant portion posted
Code:
status = LL_SessionAlloc(session, "localhost", 2901, "Livelink1", "admin", "lladmin")

If (status = LL_OK) Then
status = LL_ListObjects(session, -2000, 6504, vbNullString, vbNullString, LL_PERM_SEECONTENTS, resultset)

If (status = LL_OK) Then
status = LL_ValueGetLength(resultset, length) ' get length of the recarray

textList = ""
For i = 0 To length - 1
docName = ""
docComment = ""
status = LL_TableGetString(resultset, i, "Name", docName, 255, outSize1)
status = LL_TableGetString(resultset, i, "Comment", docComment, 255, outSize2)
textList = textList & "- " & Left(docName, outSize1) & " ---- " & Left(docComment, outSize2) & vbCrLf
Next

Text1.Text = textList

Else
Text1.Text = "Was not able to Retreive any Documents."
End If
Else
Text1.Text = "No Session Established"
End If
see the use of GetString if you are looking for an integer you will use the corresponding method for dates and so on.otherwise the program will hang

Always acknowledge a fault. This will throw those in authority off their guard and give you an opportunity to commit more.
Mark Twain

appnair

 
Ok, After some diggin I found the API that lets me know how many records are in the RecArray returned from the ListObject..

LL_ValueGetLength(obj,return Var)...

Hope this helps anyone else..
 
Thanks appnair for the info.
It looks like you sent the info about the same time I ran across it in the doc..

Yup, been doing LiveLink for about 3 days now and my code was due yesterday.. Dont ask..
So, right now I am attempting to assimulate it as fast as I can.
It would have been nice if in the doc under RecArray Management they would have put a note about using that API Proc Call to get the recarray count. I actually found the reference under the error checking section.
Oh, well life goes on.

I have had no luck using the OT knowledge base. I must be doing something wrong, because everytime I do a search in it I get back NO Results..

Well Thanks for the info,
I'm sure I will run across some more really stupid questions as I go. Maybe by the time I get this thing working I'll know it..or at least be able to get past the really stupid question phase..

Thanks
Alley
 
This is really why I prefer java since the direction is towards that there a are a lot of programmers to the language and you will see more and more helpful posts.The first time I did LAPI thru VB thru an example I cahnged the call somehow and managed to wipe out the Enterprise workspace on my test sersver.Anyway good job.LAPI can be frustrating since the errors may not mean anything to you.From my experience you can do LAPI a lot better
Get a schema book
Debug thru Builder/SDK

Always acknowledge a fault. This will throw those in authority off their guard and give you an opportunity to commit more.
Mark Twain

appnair

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top