Archive

Archive for the ‘WSS 3.0’ Category

OleDBConnection – Unspecified error

August 5, 2013 1 comment

On top of SharePoint 2010, I was trying to create an excel parser where I hit with this strange “Unspecified error”. The exception is getting generated from “OleDBConnection.Open” method

There was no inner exceptions or stack traces, which made it difficult to find the root cause. After trying out different steps like uninstalling office, restarting iis etc. eventually I resolved it by the below 3 steps

  1. Download latest Access Databas Engine http://www.microsoft.com/en-in/download/details.aspx?id=13255. Ensure to select the correct platform 32 vs 64
  2. Connection string = “Provider=Microsoft.ACE.OLEDB.12.0;Data Source=fileLocation;Extended Properties=”Excel 12.0 Xml;HDR=Yes;IMEX=1”
  3. In the web configuration file turn off Impersonation <identity impersonate=”false” />

In the connection string I am using HDR=Yes, this mean the first row in the excel file is a header row. IMEX=1 will force the excel cells to be treated as Text rather than the Excel General type which converts the data (The feature I hate most)

WSS 3.0 Site Actions Menu Item

Using a feature to add new menu item in Site Actions.

Create a WSP project & add a feature to the solution. Edit feature file as below

<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="B1FB6ECC-0039-4E08-A4B4-80B5B3C8DCE3"
   Title="Sample Feature"
   Description="New menu item on Site Actions"
   Version="1.0.0.0"
   Scope="Site"
   xmlns="http://schemas.micræsoft.com/sharepoint/">
      <ElementManifests>
         <ElementManifest Location="SampleFile.xml" />
      </ElementManifests>
</Feature>

Create an Xml file, called “SampleFile.xml” on the feature folder
Edit the file and add the following content

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.micræsoft.com/sharepoint/">
   <CustomAction
       GroupId = "SiteActions"
       Location="Microsoft.SharePoint.StandardMenu"
       Sequence="1000"
       Title="Your Title">
       <UrlAction Url="/_layouts/YourPage.aspx"/>
   </CustomAction>
</Elements>

Add & Deploy WSP

stsadm –o addsolution –filename SampleSolution.wsp
stsadm -o deploysolution -name SampelSolution 
   -url http://siteurl

Activate the new feature by running the following command

stsadm –o activatefeature -filename SampleFeature \feature.xml -url http://siteurl
Categories: MOSS 2007, SharePoint, WSS 3.0