Display a list view in InfoPath

If you want to display all entries from a SharePoint list inside your InfoPath form, browser enabled or not, then do the following.

You have a list in SharePoint already, right..
Add a data connection to that list the usual way in InfoPath
Open the “Data source” in the right task pane and select the list (it is listed as a Secondary):

Right click it and select “Repeating table” and drag and drop it to your form

The list is displayed with all entries:

Stream a wmv file

If you upload a .wmv file to a library in SharePoint you will be asked if you want to “Open” or “Save” the file, as usual:

But if you want the user to be able to stream the file directly, without being presented that message box, then you must perform some more steps. Create a new virtual directory on your SharePoint site inside the IIS (in the inetpub folder, wss, virtual directores, and then the sites folder), I named mine to “Webcasts”. Upload the wmv file to that Webcasts directory. Edit the directory security on the Virtual directory to Anonymous so that the user doesn’t get a login prompt.

Then create a new file inside the Webcasts-directory with the extension .wvx. This will trigger the wmv file and stream it directly inside Windows Media Player.

Open a text editor, such as Notepad. Type the following metafile script, but replace the URL with that of your file. Reference the audio or video file just as you would any other Web file:

You can place the metafile in the same folder as that of your digital media file. If you do so, you can use a relative path, which is simply the name of the file. The REF line would look like this:

add a href tag with only the filename: yourfile.wmv

Save the text file using the name of your digital media file followed by the .wvx extension if the metafile points to a file with a .wmv extension, or .wax if the metafile points to a file with a .wma extension, such as YourFile.wvx. You can also use the .asx file name extension for either audio or video.

Now, when you add the link to this wvx file by typing http://yoursharepointsite/webcasts/yourfile.wvx then the media file will stream in Media Player.

Error 6398

This is my platform:

A server farm with one SQL Server and one WSS 3 SP2 server (win server 2003). I have installed Search Server Express 2008 with Swedish language packs. Everything is working fine, the search is up and running and all. But, in Event Viewer I got this error message each time the indexer started (and I hate to have error messages, it is so disturbing! I want a clean log!):

Event Type: Error
Event Source: Windows SharePoint Services 3
Event Category: Timer
Event ID: 6398
Date: 2009-07-10
Time: 14:30:01
User: N/A
Computer: XXX
Description:The Execute method of job definition Microsoft.SharePoint.Search.Administration.SPSearchJobDefinition (ID aeb1e8f1-9341-417b-ab76-9442095f1019) threw an exception. More information is included below.

Retrieving the COM class factory for component with CLSID {629DA12E-9AD5-4FEC-B886-42C5982C5109} failed due to the following error: 80070422.

Hm. Looked in Central Administration on “Services on server”, and both services were started there, that is Office Server Search and WSS Search. BUT, when I looked in Services (from the Control Panel) then the “Windows SharePoint Services Search” was disabled. Started it, and now all errors are gone.

Add a link inside the webdeleted page

One annoying thing when you delete a site in SharePoint is the page that you are directed to after the deletion, the webdeleted.aspx. For me it is easy, since I know that you must go up into the URL and delete from a certain slash to get back to the site above, but for the user… no not as easy.

So I thought that putting a link that redirects you up one level OR a link that simply closes the window would be great. Well it was easy made and delivers a really good result as well – if I may say so myself, and yes I may! πŸ˜€

Remember to copy this page before editing it. And yes it will be overwritten maybe, but those are a few lines, not that hard to remember if that might happen. AND yes I want it to be used on ALL sites.

Find the webdeleted.aspx page
Copy and paste a copy inside the folder, just to be safe πŸ™‚
Open the file in good old Notepad
Add the two following simple links above the last /font tag. One link is a javascript that closes the window and the other link brings you back to the site above and that is done with ../../ tag:

Do NOT enter an entire path, only relative URLs! What this link does, is redirecting you back one level up to the parent site. That will work from any starting point. Now your “Delete web” looks like this instead of a blank page:

Setup the VPC to use your wireless network

Today I tried to install a Cisco VPN client on my laptop which has Vista 64 installed. I know, but it was not my choice to install Vista, it is my work laptop. So, turns out that there is no client for this, and maybe they will not release one either. So, to be able to connect to a customer with this laptop I thought that I would use my VPC. I changed the settings in my VPC to use the wireless network that I use. Did not work. So I googled it, and this article was really helpful. Turns out that you can install a lookback adapter as a new network connection, and then let that network connection use your physical network connection (the wireless). And only allow that adapter to use the network connection (it does not say that in the article, but it is a setting in Vista). And, yes, I now had network connection in my VPC! I only had to download a cisco client that can be installed on Windows Server 2003 (I used version 4.8.00 but I will not write here were I found it….). You understand! πŸ˜€

Script that delete old backup folders

Yey! If you want to save the server administrator (speaking!) some hell by deleting old backup folders and save disk space, then this is a solution for you!

Create a new file with Notepad and name it like deletebackupfiles.vbs and paste the following code (I cannot write the code here of course, but you can copy the code from the site http://www.mssqltips.com/tip.asp?tip=1324):

Edit the number of days on the first line, that is how old files you want to delete from the backup share. Then on the next line, enter the path to your share where the backup files are.

Remove the ‘ sign before “objFile.Delete” so that the script executes the deletion πŸ™‚
Put a ‘ sign before the MsgBox instead, or else you must press OK to every file it wants to delete.
Then, create a new file with Notepad and name that deletebackup.bat (or what ever) and enter one line to it, and that is the path to your vbs file:

c:backupscriptsdeletebackupfiles.vbs

Open Task Scheduler on your server and create a new task where you want your .bat file to start at a scheduled time. I run it the night before my fullbackup creates new folders, so that the backup share is empty.

Use a SQL data connection in InfoPath

If you want to receive data from a SQL table directly into a field in InfoPath then do the following. First, create a new library in your SharePoint site using the template ”Data connections library”:

Name the library like “SQLConnections” or something. (Choose not to display it in your QuickLaunch if you want to hide this library):

Open InfoPath and open the form in which you want your new data connection (or you can open a blank form and do the same thing there). Click on “Tools” and “Data connections” and create a new SQL database connection:

Connect to your SQL server:

Select the database:

Finish and your data connection is added. Now, click on “Convert” button:

Enter the URL of your SharePoint site and the Data Connection library that you created before. Remove the “Forms/Allitems.aspx” at the end of the URL and replace that with a filename instead, for example “myconnection.udcx”:

When you finish, you’ll see that the “Convert” button is grey. Press Close to return to the form:

Go to your field where you want to display data from the data connection source:

Publish it and test it in your browser:


Collect user information from AD through InfoPath

I wanted a webpart in SharePoint that displays certain user information from the AD. Looked at a couple of webparts Bamboo, SharePoint Boost, etc but all of those are directly connected to the AD and I did not want the user to be able to push information back into the AD. Only display it so that the user can send a request to change the information through a simple list.
So I thought that InfoPath might be able to do some lookups for me, and yes the webservice that calls on UserProfiles was perfect for this! And since I am used to InfoPath and how you can perform lookups inside the form using one specific field I thought that it could not be that hard to get all information using the “Username” field. All fields in the form are read-only and it is published as a web form. The result is the following webpart:

Mail me if you want some more explanation or instructions!

I love that you can use InfoPath without any code… Powerful!

Unable to map a SharePoint site as a network drive

I am running WSS 3 on a Windows Server 2008 and want to map my site from ie Word or the explorer. But I get the message “Network path not found”:

Or if I try to map to it or if I run “Net use” from inside the command prompt. I get the following message:

“C:Userslise.rasmussen>net use x: http://xxx.com/Shared%20Documents/
Enter the user name for ‘xxx.com’: domainloginname
Enter the password for xxx.com:
System error 67 has occurred.
The network name cannot be found.”

So I cannot open my site directly from the Explorer (via Map Network drive) cause then I get this message (“The folder you entered does not appear to be valid. Please choose another”):

Or in Explorer View from SharePoint, then I get this message (“Your client does not support opening this list with Windows Explorer”, and yes it is from the client, not the server):


I run a Windows Vista client, and the client service is installed. And one more thing, if I open a document from the site I get THREE login prompts before I can open the document. I can only press Esc but… how irritating isn’t that!!

The Desktop Experience is installed on the server, as well as WebDAV and it is rebooted. I also checked that the AAM is correct and can be reached from the server, check to that πŸ™‚

Some blogs suggest that you update the Web Folders, but that are for really old browsers and stuff… Don’t want to do that this early. That will have to be a backup plan..

I googled it many times but have not found a solution that works for me…

Simple redirect script

If you want to redirect your users to another URL when they press the “Save” button inside a list form, then just add the following in the link to the form:

/lists/yourlist/newform.aspx?Source=/thankyou.aspx

I usually use relative url’s as in the example, but you may also write the whole URL of course…

Great!