Session_OnEnd中的ADO Connection对象 [英] ADO Connection object in Session_OnEnd

查看:76
本文介绍了Session_OnEnd中的ADO Connection对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

为什么以下代码不起作用?


Sub Session_OnEnd

Dim Conn
Set Conn = Server.CreateObject(" ADODB.Connection")

Conn.ConnectionString = Application(" Connection_String")

Conn.Open' '这是错误

....

End Sub

Conn对象在Session_OnStart中以相同的方式创建并用于

整个应用程序,应用程序(Connection_String)仍然存在

这里(我测试过)。

所以我认为错误是由我们在Session_OnEnd中的事实。

Hi!
Why doesn''t the following code work?

Sub Session_OnEnd
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = Application("Connection_String")
Conn.Open ''here is the error
....
End Sub
A Conn object is created the same way in Session_OnStart and is used
throughout the application, and Application("Connection_String") still
exists here (I tested).
So I suppose the error is caused by the fact that we are in Session_OnEnd.

推荐答案

>在Session_OnStart中以相同的方式创建Conn对象并使用
>A Conn object is created the same way in Session_OnStart and is used
整个申请表


O,男孩这是一个坏主意


-

Roji。 P. Thomas

净资产管理
https:// www。 netassetmanagement.com

" Agoston Bejo" <顾*** @ freemail.hu>在消息中写道

新闻:OO ************** @ TK2MSFTNGP11.phx.gbl ...嗨!
为什么不跟随代码工作?

Sub Session_OnEnd
Dim Conn
Set Conn = Server.CreateObject(" ADODB.Connection")
Conn.ConnectionString = Application(" Connection_String" ;)
Conn.Open''这里是错误
...
End Sub

Conn对象在Session_OnStart中以相同的方式创建并被使用<在整个应用程序中,应用程序(Connection_String)仍然存在(我测试过)。
所以我认为错误是由于我们在Session_OnEnd中引起的。
throughout the application
O, Boy thats a bad idea

--
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com
"Agoston Bejo" <gu***@freemail.hu> wrote in message
news:OO**************@TK2MSFTNGP11.phx.gbl... Hi!
Why doesn''t the following code work?

Sub Session_OnEnd
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = Application("Connection_String")
Conn.Open ''here is the error
...
End Sub
A Conn object is created the same way in Session_OnStart and is used
throughout the application, and Application("Connection_String") still
exists here (I tested).
So I suppose the error is caused by the fact that we are in Session_OnEnd.



如果你告诉我们什么错误可能会有所帮助。


-
http://www.aspfaq.com/

(反向地址回复。)


" Agoston Bejo" <顾*** @ freemail.hu>在消息中写道

新闻:OO ************** @ TK2MSFTNGP11.phx.gbl ...
It might help if you tell us WHAT error.

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Agoston Bejo" <gu***@freemail.hu> wrote in message
news:OO**************@TK2MSFTNGP11.phx.gbl...
嗨!
为什么下面的代码不起作用?

Sub Session_OnEnd
Dim Conn
Set Conn = Server.CreateObject(" ADODB.Connection")
Conn .ConnectionString = Application(" Connection_String")
Conn.Open''这里是错误
...
End Sub

创建一个Conn对象在Session_OnStart中使用相同的方式并且在整个应用程序中使用
,并且Application(Connection_String)仍然存在于此处(我测试过)。
所以我认为错误是由以下事实引起的:我们在Session_OnEnd。
Hi!
Why doesn''t the following code work?

Sub Session_OnEnd
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = Application("Connection_String")
Conn.Open ''here is the error
...
End Sub
A Conn object is created the same way in Session_OnStart and is used
throughout the application, and Application("Connection_String") still
exists here (I tested).
So I suppose the error is caused by the fact that we are in Session_OnEnd.



Agoston Bejo写道:
Agoston Bejo wrote:
嗨!
为什么没有''以下代码有效吗?

Sub Session_OnEnd
Dim Conn
Set Conn = Server.CreateObject(" ADODB.Connection")
Conn.ConnectionString = Applica (Connection_String)
Conn.Open''这里是错误


错误是什么?我建议不要在这里发布,你去

aspfaq.com并在那里搜索它。你可以更快地得到答案。

...
结束子

Conn对象在Session_OnStart中以相同的方式创建并在整个过程中使用
应用程序和应用程序(Connection_String)仍然存在(我测试过)。


http://www.aspfaq.com/ 2053

所以我认为错误是由于我们在Session_OnEnd中的事实造成的。
Hi!
Why doesn''t the following code work?

Sub Session_OnEnd
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = Application("Connection_String")
Conn.Open ''here is the error
What is the error? I suggest instead of posting it here, you go to
aspfaq.com and search for it there. You may get your answer quicker.
...
End Sub
A Conn object is created the same way in Session_OnStart and is used
throughout the application, and Application("Connection_String") still
exists here (I tested).

http://www.aspfaq.com/2053
So I suppose the error is caused by the fact that we are in
Session_OnEnd.




谁可以说不知道错误是什么?


Bob Barrows


-

Microsoft MVP - ASP / ASP.NET

请回复新闻组。这个电子邮件帐户是我的垃圾邮件陷阱所以我

不经常检查它。如果您必须离线回复,请删除

无垃圾邮件



Who can say without knowing what the error is?

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don''t check it very often. If you must reply off-line, then remove the
"NO SPAM"


这篇关于Session_OnEnd中的ADO Connection对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆