Tuesday, October 25, 2011

Content By Query WebPart outputs incorrect url when there is no root sitecollection

If you have a webapplication with no sitecollection at the root url (e.g. all site collection are located under http://<webapp>/sites/…) and you use the CBQWP to query for list items (events / tasks./ … anything but documents), you will receive a ‘404 page not found’ when clicking the link.

The CBQWP uses the CopyUtil.aspx page to redirect you to the item in question (see http://weblogs.asp.net/jan/archive/2008/02/26/copyutil-aspx-a-little-sharepoint-gem.aspx). If there is no sitecollection at the root url, the site collection url will be missing from the url that is generated.

To solve this issue, edit the ‘ContentQueryMain.xslt’ file and change

<xsl:if test="$UseCopyUtil = 'True'">
<xsl:value-of select="concat('/_layouts/CopyUtil.aspx?Use=id&Action=dispform&ItemId=',@ID,'&ListId=',@ListId,'&WebId=',@WebId,'&SiteId=',$SiteId)"/>
</xsl:if>

into

<xsl:if test="$UseCopyUtil = 'True'">
<xsl:value-of select="concat($SiteUrl,'/_layouts/CopyUtil.aspx?Use=id&Action=dispform&ItemId=',@ID,'&ListId=',@ListId,'&WebId=',@WebId,'&SiteId=',$SiteId)"/>
</xsl:if>

Tuesday, October 18, 2011

SQL Server 2005 ‘Login failed’ (error 18456 state 16)

The event log of one of our SQL Servers filled up with events 18456 (every minute).

Failure Audit: Login failed for user '<DOMAIN>\<username>’. [CLIENT: <local machine>]

Looking in the SQL Server log, I found some extra information.

2011-10-18 12:52:00.55 Logon       Error: 18456, Severity: 14, State: 16.

I found this MSDN blog post, explaining most of the State codes, except for state 16.

ERROR STATE

ERROR DESCRIPTION

2 and 5

Invalid userid

6

Attempt to use a Windows login name with SQL Authentication

7

Login disabled and password mismatch

8

Password mismatch

9

Invalid password

11 and 12

Valid login but server access failure

13

SQL Server service paused

18

Change password required

 
Digging a little further, I found that State 16 usually means that the target database cannot be located. I most cases, this is due to an SQL Server Job that targets a deleted of offline database.
 
Deleting or disabling the job gets rid of the errors in the event log.

Tuesday, October 4, 2011

Update Mango Beta 2 to RTM without restoring to NODO

Apparently, it's possible to update your Windows 7 phone with the Mango Beta 2 installed to the RTM version of Mango without having to restore the NODO backup (and loosing all you have done since). Just update Zune to version 4.8, connect your phone and you will receive 2 updates. see http://forums.create.msdn.com/forums/t/92311.aspx