Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Accessing SQL Server from Global.ASA

Author  Topic 

foxprorawks
Starting Member

17 Posts

Posted - 2005-09-21 : 04:19:30
Hi

I have an application written in classic ASP which uses Windows Authentication in SQL Server.

This seems to work fine, except when we try to write to the database in Session_OnEnd in Global.ASA.

We don’t get an error and although logging is enabled in SQL Server, no failed logins are reported. Nevertheless, the database is not updated.

I’ve tried adding the IWAM_Servername user to SQL Server, but that hasn’t made any difference.

Has anyone any thoughts on how to rectify this? At the moment, both SQL Server and IIS are running on the same PC, but we need to find a solution when they are on different PCs as well.

HappyCamper
Starting Member

8 Posts

Posted - 2005-09-21 : 16:13:20
This article hopefully can help explain the problem...

http://www.devguru.com/technologies/asp/9183.asp

Go to Top of Page

foxprorawks
Starting Member

17 Posts

Posted - 2005-09-22 : 05:09:17
That certainly explains the problem, but it doesn't provide a solution.
Go to Top of Page

HappyCamper
Starting Member

8 Posts

Posted - 2005-09-23 : 09:37:26
I'm only guessing here, but I'm assuming you want to capture and log some information when the user exits the application. This can happen by either the user closing their browser window, there is some type of "log-out" button the user clicks to exit the application, or the session times out.

The main idea is to write to the database when some event occurs on the client side that indicates the user is done, but BEFORE the session has ended.

1. If you have a "log-out" button, write to the database within that button click event.

2. To capture the window closing event, use client-side scripting (JavaScript, etc) to capture the event. For more info on this, see
http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onunload.asp

3. If you are attempting to capture info when the session times out, you can still use client side scripting to capture a "timed" event. The idea is to time how long it's been since the user has refreshed the page - if the amount of time is almost equal to the Server time-out period, write to the database just before the Server times out. For more info, see:
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/settimeout.asp

Disclaimer: The above links refer to Internet Explorer, and may or may not work in other types of browsers.

Hope this helps.


Go to Top of Page
   

- Advertisement -