connect to sharepoint 07 via oledb not working
I'm trying to access a list from sharepoint
when I do i get an error
Here is my code
VB Code:
DataSet dt = new DataSet();
string query = "SELECT * FROM list";
string site = "http://sp.markonsolutions.com/Lists/Security/";
string list = "35E70E04-6072-4F65-B741-4C75D5F3E327"; //security db
string myConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;WSS;IMEX=2;RetrieveIds=Yes; DATABASE="+site+";LIST={"+list+"};";
OleDbConnection myConnection = new OleDbConnection();
myConnection.ConnectionString = myConnectionString;
OleDbCommand myAccessCommand = new OleDbCommand(query,myConnection);
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(myAccessCommand);
myConnection.Open();
myDataAdapter.Fill(dt);
//execute queries, etc
myConnection.Close();
Re: connect to sharepoint 07 via oledb not working
first, why are you posting a c# question in a vb.net forum?
here's a connectionstring to connect to sharepoint:
vb Code:
Provider=Microsoft.ACE.OLEDB.12.0;WSS;IMEX=2;RetrieveIds=Yes; DATABASE=http://pp1webofficelivecom.officelive.com/Documents/;LIST={5999B8A0-0C2F-4D4D-9C5A-D7B146E49698};
from www.connectionstrings.com
you'll probably find that you need to set your Target CPU to x86 to use Microsoft.ACE.OLEDB.12.0, but i don't know how to do that in c#