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 connectivity problem with sql server.

Status
Not open for further replies.

zeppyboy

Programmer
Jul 1, 2004
9
0
0
CA
Hello,

I posted that question in the vbscript forum and maybe you can help me better on that.

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 also use this connection string in my application_onStart() and it works fine.

I read about this error on support.microsoft.com that permission rights could be the cause of this error. But cannot find where? Is there different permissions used in session's sub by web server?

Hope someone can help me.

Thanks

Jeff
 
Maybe it's an order-of-battle problem. Perhaps at session_onEnd(), the variable has already been dropped. Msgbox it out and see what you get.

Phil Hegedusich
Senior Web Developer
IIMAK
-----------
Boy howdy, my Liberal Studies degree really prepared me for this....
-----------
A skeleton walks into a bar, and says "I'll have a beer and a mop.
 
Thanks for your reply.

But its impossible, i read that webserver drop nothing until the sub is complete.
 
OK, did you try what I said to try? Can you VERIFY that the connection string variable still exists?

Phil Hegedusich
Senior Web Developer
IIMAK
-----------
Boy howdy, my Liberal Studies degree really prepared me for this....
-----------
A skeleton walks into a bar, and says "I'll have a beer and a mop.
 
I try with no variable for connection string, so my i have the following code and still get the same error:

dim dbConnection
Set dbConnection= Server.CreateObject("ADODB.Connection")
dbConnection.Open "Provider=SQLOLEDB;Data Source=......ect."

i get my error on the 3rd line.

and before the 3rd line, my dbConnection variable is still there (connection object).
 
Not sure if I can help beyond the two articles at MS.

Good luck,
PH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top