Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP : global.asa file connectivity problem with sql server

Status
Not open for further replies.

zeppyboy

Programmer
Jul 1, 2004
9
0
0
CA
Hello,

This is my first post in tek-tips.com. Was not sure if it was better to post my question in this forum or in a sql forum.

I'm having a problem with my Session_OnEnd() sub in my global.asa.

I have to make a sql connection to my database to update one field in my table when session is over. But everytime i try to open the connection, i get this error :
error number : -2147467259
error description : [DBNMPNTW]ConnectionOpen (CreateFile())

Im using the same connection string that i use everywhere on my website and i have only this problem in the global.asa.

I dont know where to look now.

Hope someone can help me.

Thanks

Jeff
 
I found this KB article:
"CAUSE
Microsoft Windows NT Server is denying access to the SQL Server. This error can be caused by the way Users, Groups, Rights, and Permissions are configured. Specifically, Microsoft Internet Information Server (IIS) does not have permissions to open a Named Pipe connection to the SQL Server"

Hope it helps
 
Yes i read that article but still cannot find whats my problem.

I use the same connection string to make an update in my application_onStart() sub and it works fine.

is there differents permissions use for the session event in the global.asa?
 
I don't know the answer, but if I had to guess I would assume that the session_onend triggered after the session was closed. If so, you're connection string is gone. What code are you trying to execute?
 
Not suppose to do that. Session_onEnd() is there to execute code before the session is close.

I want to update a field in my database before the user completely quit my website.

I can do that in my code when user click on logout, but a lot of people just close the window without logout.
 
on logout if you call session.abandon variables are not destroyed until the script you are executing is finished. since no script is executing when timeout shuts the session down, I'm not certain the case is the same.

is your connection string stored in the session object? if it is, have your tried storing it in the application object?
 
Hello zeppyboy,

>The session_onEnd is there to execute code before the session is close
yes, but if only the session is timed out _or_ session.abandon is expressed called.

regards - tsuji
 
forecasting:
no i dont have my connectino object store in a application or session object. I create my connection only when i need it. So my connection is create in my session_onEnd() and close at the end of the sub.

Tsuji: Yes i use the session.abandon when my user click on logout to execute my session_onEnd() sub immediatly. Sub is also call when my session is timed out.

Its a weird problem.

I have another web server on other computer and i have no problem with my connection in sesssion_onEnd. I look at the permissions for the global.asa for the 2 websites. I found a difference between the two. I put permissions like the server who work #1, but i still have the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top