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!

Having issues with this code

Status
Not open for further replies.

sxjain3

IS-IT--Management
Oct 1, 2004
8
US
Can somebody help me with this line of code.

If (status = LL_OK) Then
status = LL_AssocGetInteger(objInfo, "VolumeID", parentVol)
End If

If (status = LL_OK) Then
status = LL_AssocGetInteger(objInfo, "ID", parentID)
End If

End If

If (status = LL_OK) Then
logMsgs = logMsgs & "Accessed Personal Workspace" & vbCrLf

' Add document -- This is where i get error
status = LL_AddDocument(session, parentVol, parentID, _
"Text", "c:\LAPI.xls", objInfo, versionInfo)

If (status = LL_OK) Then
status = LL_AssocGetInteger(objInfo, "VolumeID", nodeVol)
End If


If (status = LL_OK) Then
status = LL_AssocGetInteger(objInfo, "ID", nodeID)
End If

End If

The value od status is <> 0 as soon as the call to LL_AddDocument is done. I am successfully able to make the connection. Also the parentvol is a negative value but ths status value comes out 0, so I assume that it is reading the volume successfully.

Thanks
 
Shouldn't that be an escaped deal like "c:\\LAPI.xls"
It is in Java anyways

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

appnair

 
Hi appnair,

Well the code I sent you has a single backslash as I was trying my option but it originally had \\.

Now is the negative parentvol the issue. It is exactly the same as the parentID although reverse in sign. after I had populated the parentID, I went to the portal and check for this ID and it matches my personal workspace.

After the LL_ADDdocument command, the status is = 100402. Does it mean anything.How can I find the exact error?

This is my first day LIVELINK development and VB is the only option. I may be asking some questions incorretly ?

Any help in this case is apprecaited.

Sameer
 
I do not know VB but it could be due to a variety of reasons.You are sure that you are establishing a session and things like that.You have to type test everything in lapi
Long LL_AddDocument( _
ByVal session as Long, _
ByVal parentVolID as Long, _
ByVal parentID as Long, _
ByVal name as String, _
ByVal filePath as String, _
ByVal objectInfo as Long, _
ByVal versionInfo as Long )
Are you sure that you are adhering to the types correctly.Maybe you will have to init the vesionInfo as a
Long .The OT sample has everything as long try that
[/quote]

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

appnair

 
Hi,

I am setting the session and all the other values.

Infact I am able to delte files as well as download them. Its only that when I try to add a file that it start to fail.

What exactly is the differenct between parentvolid and parentid ? Probably there is something wrong here, but then they work during delete and download just fine.

Thanks,

Sameer
 
Just a few things that come in common sense.Using your http
connection are you able to add the c:\lapi.xls in your personal workspace.Is this the same LAPI user.Does this file
alraedy exist in the container.Every object that resides in an Enterprise workspace,Personal workspace has a parentid.When you come to undertand the livelink schema you will understand a whole lot.An enterprise work space is a volume (usually 2000 or 2001).Enterprise workspace has a subtype of 141 and personal has a workspace of 142
Let's assume in your personal workspace you create a folder called 'My LAPI Folder' .The object ID that shows as llobjid
in the URL will become the parentid for any other objects in that folder.
Code:
Assume that the folderid of "My Lapi Folder" is 543213.So if you need to add something to that your call will become

status = LL_AddDocument(session, parentVol, 54213, _
                              "My Document", "c:\\LAPI.xls", objInfo, versionInfo)

Try this method.Or you could bring up builder and trace the whole code.If you can send me the whole file at appoos@hotmail.cvom I will take alook at that.Try if you can get a document in the Enterprise Workspace where this LAPI user has perms




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

appnair

 
Hi,

There is no file with the same name in my personal worksapce. Also the file is loaded for the same user with which it was lgged in.

I have sent you the code.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top