Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Need some help converting VB to PB for sharepoint ole

1 view
Skip to first unread message

dennisl

unread,
Sep 14, 2009, 2:09:00 PM9/14/09
to
I nedd some help converting a VB snippet to PB. I'm trying
to connect to a SharePoint list. I'm getting a -2 error
when I try to connect. I assume I'm missing a dll or
something. We don't really do a lot of OLE so I would
appreciate any help. PB 11.5

Here is the VB:

Dim mySite as SPSite = New SPSite("http://mysite")
Dim mySite As SPWeb = SPContext.Current.Web
Dim listItems As SPListItemCollection =
mySite.Lists(TextBox1.Text).Items

Dim item As SPListItem = listItems.Add()

item("Title") = TextBox2.Text
item("Stock") = Convert.ToInt32(TextBox3.Text)
item("Return Date") = Convert.ToDateTime(TextBox4.Text)
item("Employee") = TextBox5.Text
item.Update()

PB so far
/****************************************************/
oleobject mysite, listItems, item
long ll_return
setpointer(hourglass!)

mysite = create oleobject
ll_return =
mysite.ConnectToObject('http://chqsrvr08/Initiatives/Lists/Initiatives/ProjectNew.aspx'
, 'SPSite')

//listItems = create oleobject
//listItems = mySite.Lists('').Items

//item = CREATE OLEObject
//item = listItems.Add()
//
//item("Location") = 'CHQ'
//item("Department") = 'Software Development'
//item("Title") = 'Title goes here'
//item("Description") = 'Description goes here'
//item("Assigned to") = 'Dennis Little'
//
//item.Update()

destroy mysite
destroy listItems
destroy item

0 new messages