Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a situation where I can retrieve results using this query

Select * From myList (myList being Sharepoint list)

but cannot get results from this

select First From myList Where First=JoeBob

No insert query works either.

$connString = 'Provider=Microsoft.ACE.OLEDB.12.0;WSS;IMEX=2;RetrieveIds=Yes;DATABASE=https://sharepoint/;LIST={897BJ54-AAAA-4989-BH56-8JFJS758BN};'
$spConn = new-object System.Data.OleDb.OleDbConnection($connString)
$spConn.open()
write-host $spConn.State
$qry='SELECT * FROM myList'
$cmd = new-object System.Data.OleDb.OleDbCommand($qry,$spConn)
$da = new-object System.Data.OleDb.OleDbDataAdapter($cmd)
$dt = new-object System.Data.dataTable
$da.fill($dt)
$dt

Why is this?

share|improve this question

migrated from stackoverflow.com Nov 15 '11 at 0:18

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer 1

I've done some Powershell scripting with OleDB and SharePoint and blog about it here: http://sev17.com/2009/02/using-oledb-with-sharepoint-lists/

It looks like you are missing single quotes around JoeBob:

"select First From myList Where ='JoeBob'"

As noted in my blog post inserts statements are not supported.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.