Saturday, December 20, 2008

Force Windows XP Explorer to Sort By Name

I am an old fashioned Windows user, I don't like current Windows XP Windows Explorer sorting method, which it can "remember" your settings for each folder. Instinctly I think it will waste disk space. I always missed the old Windows sorting method that is always sort files by file name, only when I tell it to sort by date, it will sort by date, but once I close it and reopen it, I hope it still sort by name instead of sort by date. And I once and always use the "detail" view of Windows Explorer.

This works perfectly before when I choose to "Not remember settings for each folder". But one day, for some unknown reason, it just can not work. Everytime I open Windows Explorer, it always sort files by date, as I did not choose "remember" settings, it will sort by date for EVERY single folder. This is really annoying and frustrating. I tried many ways to solve this problem, I sort the folders by name, then close Windows Explorer, it has no effect, next time when I open it, it still sort by date. I even tried somebody's suggestion, that is to click Ctrl plus the close button on top right corner, still same, no effect. I tried to change the "remember" setting back and forward, hope it can remember to sort by file name, well, still same, once I enable it to "remember", it remember to sort by file name, but once I change it back to "not remember", it remember to sort by date!

I tried to think what I might do before, and I noticed everytime I open Windows Explorer, it will firstly go to the page of "My Computer" which will list all my hard disks, in this view, there is no sorting method above like other folders' detail view does. But, you still can click the above column head to sort it, I tried to click all the column headers one by one, and finally go back to sort by type, then close Windows Explorer. Guess what? Next time I open it, everything works as I wish! My computer view show hard disks together as sort by type, My documents view sort files by file name, my D drive, H drive, I drive all sort by file name now.

Seems the "sort by filename" is related to "sort by type" for My Computer view. If you have similiar issue, please try this way, and let me know your result.

Wednesday, December 17, 2008

How to insert a data source in SharePoint Designer 2007?


Actually, the difficulty is caused by a bug of Microsoft. Below are detail steps:

 

1. Click "Connect to a database" in "Database connections", click Configure database connection, click Use Custom String, click Edit, select "Provider for OLEDB" and type the following connection string:

 

Provider=OraOLEDB.Oracle;Data Source=wise;Persist Security Info=True;User ID=wiseq;Password=wiseq;Unicode=True

 

(Replace the parameters for Data Source, User ID and Password with your own)

 

2. Click Next and you will see an error which says "an error occurred while retrieving the list of tables from the root Database", click OK, click "Specify custom Select, Update, Insert…", click Edit Command and type the command which looks like:

 

select * from project

 

click Finish, click OK.

 

3. Then, expand the left pane of SharePoint designer, expand _catalogs--fpdatasources, you will find a new xml file whose name is the same as your connection name generated. Double click it to open it. The current string shows

 

<udc:DataSource xmlns:udc="http://schemas.microsoft.com/data/udc" MajorVersion="2" MinorVersion="0">

<udc:Name>changeora</udc:Name>

<udc:ConnectionInfo>

<DataSourceControl><CDATA><asp:SqlDataSource id="SqlDataSource1" runat="server" __designer:Provider="OraOLEDB.Oracle" __designer:customcommand="true" ProviderName="System.Data.SqlClient" __designer:customconnectionstring="true" SelectCommand="select p.deptno, p.dname from scott.dept p" ConnectionString="Data Source=wise;Persist Security Info=True;User ID=wiseq;Password=wiseq;Unicode=True;Initial Catalog=root;" /></CDATA></DataSourceControl>

</udc:ConnectionInfo>

<udc:Type MajorVersion="1" MinorVersion="0" Type="Sql"/>

</udc:DataSource>

 

You can modify the provider name and delete the Initial Catalog. The expected result looks like

 

<udc:DataSource xmlns:udc="http://schemas.microsoft.com/data/udc" MajorVersion="2" MinorVersion="0">

<udc:Name>Custom Query</udc:Name>

<udc:ConnectionInfo>

<DataSourceControl><CDATA><asp:SqlDataSource runat="server" ConnectionString="Data Source=wise;User ID=wiseq;Password=wiseq;" ProviderName="System.Data.OracleClient" ID="SqlDataSource1" SelectCommand="select p.deptno, p.dname from scott.dept p" __designer:Provider="OraOLEDB.Oracle" _designer:customcommand="true" __designer:customconnectionstring="true"></asp:SqlDataSource></CDATA></DataSourceControl>

</udc:ConnectionInfo>

<udc:Type MajorVersion="1" MinorVersion="0" Type="Sql"/>

</udc:DataSource>

 

4. Save the xml. When you click Show Data and you should able to see the data populated.

Sunday, August 10, 2008

Windows Server 2003 SP1 May Cause Problems To SharePoint

Today is a very happy to me. I spent so long time, and at last solved several problems.

Q1. If I put abc.htm into some folder, then I can use IE to access it, but if I put abc.asp in, IE will always complain 404 error.
A1. It's because you need to set "Allow ASP" in the "Web Service Extensions" in IIS admin tool. By default it is turned off by SharePoint.

Q2. I put an asp page in folder, but when trying to get Request.Form, it always returns empty.
A2. It's because when you enable "Anonymous Access" in IIS, you MUST also enable "Windows Integrated Authentication", otherwise your ASP can not get form content.

Q3. This is the very hard part. After install SharePoint (WSS3), I can access http://servername on server IE, but when I access http://www.servername.com, it will ask me for password, and after enter 3 times of correct password, it will fail. But on client side, it works. Also, the reporting services in SharePoint admin behavior very strange, it can be worked on http://servername, but refuse on servername.com, also in server site collection it always cause error. And all of my previous working web services now all report "Authenticaiton fail".
A3. I tried many ways and searched for long time, and at last I searched this string in Google: ""An error occurred during logon" 537 NT AUTHORITY\SYSTEM 0xC000006D" because I found everytime I logon fail, it will show an event in Eventlog include above string. By searching that string, I found a page in Google: http://www.developmentnow.com/g/91_2005_7_0_0_560780/IIS6-NT-Authentication-fails.htm, it indirect me to here: http://support.microsoft.com/?id=896861, it says the cause is you installed Windows Server 2003 SP1:

This issue occurs if you install Microsoft Windows XP Service Pack 2 (SP2) or Microsoft Windows Server 2003 Service Pack 1 (SP1). Windows XP SP2 and Windows Server 2003 SP1 include a loopback check security feature that is designed to help prevent reflection attacks on your computer. Therefore, authentication fails if the FQDN or the custom host header that you use does not match the local computer name.

And the solution is:

Method 1: Disable the loopback check

Follow these steps:
1.Click Start, click Run, type regedit, and then click OK.
2.In Registry Editor, locate and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
3.Right-click Lsa, point to New, and then click DWORD Value.
4.Type DisableLoopbackCheck, and then press ENTER.
5.Right-click DisableLoopbackCheck, and then click Modify.
6.In the Value data box, type 1, and then click OK.
7.Quit Registry Editor, and then restart your computer.

By following that, after restart server, seems everything works ok! I must remember this in case in future I meet same error, and it may help you too.

Tuesday, May 20, 2008

SharePoint workflow can not start

It spend me so long time to get this problem solved.

1. I found a blog, it just says: to check the log. ok, then I go to check the log. Found it says my "Shared Services Provider" doesn't work.

2. I go to admin, create a new SSP, but it complains provision does not work, go to check log again. Found it says somebody else me is the site owner.

3. Go to command line, type stsadm -o siteowner to change it to myself. Now it complains some parameter does not work.

4. Found an article saying to add the app pool id into site admin, but it already there.

5. So I type in the below command to force my account be the farm admin: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>stsadm -o updatefarmcredentials -userlogin ds\sseadmin -password password, then try again.

6. It worked!

Now if you can not start your workflow, please post comment here, and I will try my best to answer your question.

Friday, March 7, 2008

Debug in Microsoft InfoPath 2003

There is no direct way to debug in Microsoft InfoPath 2003. However, Microsoft provide a very tricky way to debug in it.

All you need to do is this:

Add a "stop" in the load script.

That's it! Then when you open the InfoPath form, you can choose which debugger you want to debug it, then you can step in, or set other breakpoint in it.

Search

Google