October 21, 1999

Count ASP Sessions

Question: I am trying to count the number of users (sessions opened) to a given app. It easy enough to increment an Application variable with Session_Onstart and decrement it with Session_OnEnd. My problem is that I want to get a count for users that are external to my company (basically

Make Variable Available to All Pages

Question: Can I use a global variable in VBScript and make it accessible from any Web page? Answer: There is no such thing as a global variable in Web pages. Each time you ask for a Web page, a new instance of the page is created. If you want a

Find the Path of a Project With ASP

Question: Is there any way to programmatically determine the path of the current ASP page on the server? I am trying to access a specific text that I added to the server in a virtual directory and I don’t have immediate access to the drive path. Answer: Use Request.ServerVariables(“PATH_TRANSLATED”) to

Determine Which Submit Button Was Clicked

Question: I have a Web page with a form(action=sample.asp),frmProduct. The form has some textboxes (one of which is a key field, sav txtKey) and two submit buttons: one for retrieve (btnRetrieve) and one for delete (btnDelete). In sample.asp, how do I find out which button was clicked? Answer: Name all

Reference a DLL From an ASP Page

Question: I wrote a DLL in Visual Basic and I want to use its functions in ASP. I created a server.CreateObject(“projectname.classname”) and tried to call some of the methods of the object, but received “Automation error Invalid syntax.” How do I use the object’s methods? Answer: Once you create the

Get Count of Records in a Recordset

Question: How do I get the number of records from a “select * from dept where deptno = ..”? I want to know how many records are in my recordset without having to write a for loop to go through each record. Answer: If all you need is the count

Leverage Office to Spellcheck RichText

Integrate Microsoft Word 97’s spellchecking capability into VB apps while maintaining formatting within a rich textbox. To test this code:1. Create a standard EXE project in VB.2. Add the RichTextBox control from the Components menu.3. Add a reference to the Microsoft Word 8.0 Object Library.4. Drop a RichTextBox and a

Handle Update Collisions in ADO Disconnected Recordsets

Data-access techniques using cached data on the client for updates is possible using disconnected recordsets. This technique generates collisions in some situations. However, the technique for dealing with collisions rows that the server rejects differs in ADO from the other models such as RDO and DAO. In ADO, Filter property

Minimize Source File Dependencies to Reduce Compilation Time

To an extent, the orthodox approach of dedicating a separate .cpp and .h file for every class is the way to go. However, in real world programming, you soon find yourself recompiling every app for hours just because you added another data member to a class. I normally group several

No more posts to show