This article may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. To maintain the flow of the article, we've left these URLs in the text, but disabled the links.
|
|
GEEK I have a question about the wonderful (but frustrating) Summary Information Component for ASP. When I use it, can I specify the order in which the files are listed? If so, how can I do this? By default, they are listed by file name, but I would prefer to order the entries by date or time. GEEK The Summary Information Component (ASPSum-Info, which is included in the Microsoft Internet Information Server Resource Kit, available from Microsoft® Press), doesn't allow you to specify an alternate sort type for enumerating files. You would have to prepare your own independent list of files based on your own sort criteria, then pass the files one at a time to ASPSumInfo to extract details in the manner you want. GEEK It seems like Internet Information Server (IIS) doesn't accommodate browsers that don't handle cookies or cases where users have set their browser to not accept cookies. The only solution is to use the Cookie Munger. Why can't there be an option within IIS that takes care of this? For example, if it finds that the user won't accept cookies, write the cookie to a temporary database and use the information from there. Do I have to accept the use of cookies? Client-side cookies provide a very clean and easy way to fix this problem. The client can maintain a cookie element that identifies the user so that the server can maintain things like shopping carts that are directly associated with the user and can easily be returned to at any time in the future. There are ways to maintain such information without client-side cookies, but they are cumbersome and usually need to be customized to the specific design of the Web site. It traditionally involves embedding some form of identification into the URL. There are many different ways to accomplish this, but the main problem is that every anchor on every page must be altered to reflect the session ID that needs to travel around with the user. This is precisely what the Cookie Munger that you mention does. (The Cookie Munger comes with the Microsoft Internet Information Server Resource Kit.) As you no doubt have determined, this can impose a heavy processing penalty onto every Web page. For sites that really need to deal with non-cookie-enabled browsers, testing the user coming into the site for support of cookies is the best way to handle this. If the browser supports it, then continue on to the normal site; if it doesn't, then switch the user over to a mirror copy of the site, but with the Cookie Munger installed. This way, only the cookieless users will be affected by the processing overhead. GEEK I have the DirectX® 6.1 SDK, Visual Basic® 6.0 Professional, and Delphi 2 Developer. I cannot figure out how to use DirectX in either Visual Basic or Delphi. Do I need something else to use DirectX in either of those programming environments? Do you know where I can get sample source code for Visual Basic and Delphi? I'm not sure about Delphi support. You should check with Inprise about that. GEEK In the May 1999 issue of MIND, Paul Yao wrote that browsers running on Windows® CE don't support databinding, which allows client-side queries to server-side databases. Does this mean that devices using Windows CE and a browser won't be able to use a search engine? Databinding is a feature of Microsoft Internet Explorer that allows database resultsets to be bound (hence the term "databinding") to a table or other HTML elements on a page. This allows the server to return a large table of data, but on the client this data is filtered and sorted before being displayed. a benefit of this is that if the user wants to resort or refilter the data based on different criteria, it can be done as a client-side operation without needing to do a round-trip to the server to get the new data. Databinding was first introduced with Internet Explorer 4.0, and tremendous optimization enhancements have been made to this feature in Internet Explorer 5.0. GEEK I need to print reports from the browser and I'm trying to find out what my options are for controlling the formatting. Any suggestions for where I should concentrate my efforts? The client is Netscape Navigator 4.5. The current versions of both Netscape Navigator and Internet Explorer now support the print method, so you can use code similar to |
|
to bring up the browser's print dialog and send the current page to the printer.
But maybe you want to produce a different page for printing than you do for displaying within the Web browser. The Cascading Style Sheet (CSS) support in Internet Explorer allows you to specify styles specifically for printing. So if all of your changes can be defined as CSS styles, then all you need to do is use this code: |
|
The styles defined in this section will only be applied to the printed version of your pagesas opposed to the screen version of your pages. And since both the print and display styles can be included on the same Web page, all of this happens on the client, without the need for pulling down a new page from the server. GEEK How can I print something like a ticket or a page on the client's printer using Active Server Pages (ASP)? Here's another thing to remember: anything that allowed you to generate a printout with no user interaction would be considered a security break and cannot be allowed from script code running on a Web page. That said, see my response to the previous question for ideas on printing your page. GEEK I have some reports that currently exist in Microsoft Access and that need to be available to a client. Unfortunately, their workgroup doesn't have a unified desktopthere are different OSs and applications, so using Microsoft Access isn't going to work. The client needs to be able to run and print the reports locally. Is there any way to control the printing format, such as page breaks? Fortunately, starting with Internet Explorer 4.0, you can achieve this using Cascading Style Sheets. It allows you to make some style definitions that apply to either the display or print versions of your page. This is done by using code like the following: |
|
You can use <style media="screen"> in the first case so that you have totally different (instead of overlapping) styles for the screen and printer.
In your particular case, you want to force a page break. Here is how you would do that: |
|
Note that in this case you don't need to invoke the media="print" attribute since page breaks have no screen representation. You then insert a page break into your page like this: |
|
GEEK Is there a way to script an HTML link to perform the same action as selecting Save Target As? I have an ASP page that has a Microsoft Excel MIME type. It reads recordset data and produces a table. When a user clicks on the link, the browser spawns Microsoft Excel and loads the spreadsheet with the recordset data. I want the user to be able to directly download the file instead of having it open in the browser first. For example, I right-click on the link, the file can then be saved directly to the client machine. Allowing the clicking of a link to silently download a file is a security risk, as I am sure you can understand. And while I'm sure you would be perfectly fine (and perhaps prefer) having a dialog come up telling the user they are downloading a file, and allow the user to specify the location, there isn't any way to do this that I know of right now. GEEK Do you know of a way in SQL Server to query for rows whose startdate and enddate is a range in which a user-defined value is a member? I have an events table with startdate and enddate. Let's say a given event starts on 5/1/1999 and ends on 10/5/1999. Say the user has selected the day 7/20/1999. Since 7/20/1999 is within the date range 5/1/1999 to 10/5/1999, the event row should be returned, but my simple query doesn't catch it. I was thinking it might work if I could convert all dates to an integer value, maybe the number of days since 1998. (Doesn't Microsoft Access do something like this for the internal storage of dates?) Then I could just use the comparison |
|
Is there such a conversion function in SQL Server? Does it even make sense to do it this way? GEEK I needed something similar for a page I was creating that would report on news items that users had added to the database. The idea was that the user could specify a start date and strike date for the news item, and as long as the current date was within that span, the news item would show up on the page. Here is the SQL statement that I used: |
|
Note that I am using the VBScript Now function to get the current date.
Then I pass this date into a simple function that converts this value into what SQL expects for a date value. Not immediately seeing any documentation that described this format, I used a little trial and error and found that the following is the proper algorithm: |
|
So assuming you are using ASP, you can just insert this code into the appropriate places on your page and it will do the right tests for you. GEEK After reinstalling Visual Basic 5.0, I get the following error when I try to use Toolbar and other custom controls: "License information for this component not found." Now, I'm sure that I have licensed the ActiveX® control. What should I do? |