Flylib.com

Books Software

 
 
 

Troubleshooting

Troubleshooting

Cannot Insert Data View

graphics/troubleshooting_icon.jpg

I'm trying to insert a Data View, but the Insert Data View menu option is not enabled.

The Data View relies on Windows SharePoint Services being enabled in the Page Options dialog box. Select T ools, P a ge Options and click the Authoring tab. Make sure that the SharePoint Services check box is checked.

Even though the Insert Data View menu option is enabled, you will still not be able to insert a Data View if you are not connected to a server running Windows SharePoint Services. The Insert Data View menu option will also fail if you try to use it on a disk-based Web site.

Cannot Connect to SQL Server

I have opened a Web site in FrontPage on a remote Web server and am trying to connect to another server running SQL Server, but it is failing.

When you are creating a connection to SQL Server, there are two methods you can use to authenticate—Windows Integrated and SQL Server authentication. When using Windows Integrated, Windows will try to automatically authenticate you to SQL Server. When using SQL Server authentication, you must specify a username and password when configuring the connection.

If you choose Windows Integrated as your authentication method, in most cases the SQL Server must be running on the same computer as the Web server. This is because Windows Integrated authentication to SQL Server is designed to fail when your credentials are being delegated .

What that means is that you are logged in to your workstation computer and when you open the Web site on a remote Web server, your user credentials are used to authenticate to the Web server. When the Web server then attempts to authenticate to SQL Server, it automatically passes your credentials to SQL Server to try and authenticate you. This is called delegation of credentials , and it will always fail. The solution is to either use SQL Server authentication or run SQL Server on the Web server.

For performance reasons, it is best not to run SQL Server on the same computer that is running the Web server if you expect a lot of traffic on your Web site. Therefore, SQL Server authentication might be a better option, depending on your needs. The downfall to SQL Server authentication is that the username and password are saved in the connection string as clear text.

You will need to weigh the pros and cons of both methods and decide which is best in your environment.

Front and Center: Formatting with XPath

You already know that Data Views are created using XSL and XSLT. What you might not know is that the data returned by a Data View can be formatted using another technology known as XML Path Language , or XPath.

XPath is a standards-based language designed to allow a developer to easily refer to specific elements in an XML file. However, XPath also allows the developer to use expressions and functions to act upon XML elements.

FrontPage uses XPath to format specific data in a Data View. As a user of FrontPage, you don't have to know anything at all about XPath. FrontPage will generate the necessary XPath code for you based on options you choose in the user interface.

Suppose that you want to format the UnitPrice field as currency. You can do so as follows :

  1. Open a Web page on which you have a Data View displaying the UnitPrice field.

  2. Click once on one of the values in the UnitPrice field. The value will be bordered by a yellow border when it is selected.

  3. Right-click on the value and select For m at Item as, C urrency from the menu to display the Format Number dialog box as shown in Figure 38.42.

    Figure 38.42. The Format Number dialog box is a WYSIWYG editor for XPath.

    graphics/38fig42.gif

  4. Change the options as desired or click OK to accept the defaults.

The UnitPrice field is now formatted as a currency value, and FrontPage is applying that formatting using XPath.

The For m at Item as menu item will contain different options based on what type of field you have selected. For example, if you have selected a field that consists of text, the options on the For m at Item as menu are T ext, B oolean, H yperlink, and P icture.

Using XPath, FrontPage makes it easy to format your Data View just the way you want it.