Re: Problem with Response.Request()
- From: "Marc Llenas" <mllenas@xxxxxxxxxxxxx>
- Date: Thu, 13 Oct 2005 11:38:47 +0200
Bob thanks for the tip on the include. Will implement that asap.
About the original problem, still no luck. If I move the Response.Request to
the beginning it works.
-------------------------------------------------
<%@ LANGUAGE = VBScript %>
<!--#include file="conn0.inc"-->
<%
Response.redirect ("user_wish.asp")
------------------------------------------------
Anywhere past the beginning it redirects to index.asp and there is no other
redirect statements in the code... Very very strange.
Will keep investigating.
Marc
"Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx> escribió en el mensaje
news:uDAd8knzFHA.2064@xxxxxxxxxxxxxxxxxxxxxxx
> Here is how I do it:
> my include file contains a function that returns an open connection
> object.
>
> <%
> dim connectstring
> connectstring = "Provider=Microsoft.Jet.OLEDB.4.0; ..."
> function GetConnection()
> dim cn
> set =createobject("adodb.connection")
> cn.connectstring = connectstring
> cn.Open
> Set GetConnection = cn
>
> end function
> %>
>
> In your case, you might add a parameter to this function to specify which
> connection to return.
> You can add a sub to close and destroy a connection as well.
>
> In my page, I do not call that function until immediately before I'm ready
> to use the connection. I take care of all the upfront work first (data
> validation, building sql statements, etc) then, if all is well, I call the
> function. That way, I'm not needlessly opening a connection if I don't
> need
> to.
>
> Also, since you are using Execute to run the SELECT statement, there is no
> need to instantiate a recordset object prior to running the Execute. In
> fact, it's a waste of time: the Execute statement creates its own
> recordset
> object behind the scenes. That recordset is returned, and, when a "set var
> =" statement was used to call the Execute statement, the recordset is
> assigned to var, replacing whatever var already contained, even if it
> contained nothing.
>
> Bob Barrows
> PS. Any progress on the actual problem in your OP?)
>
> Marc Llenas wrote:
>> Actually Bob, one more question about creation/destruction of conn &
>> rst.
>>
>> Because the application has several ASP pages, all of them working
>> with rst, I'm currently using an include that takes care of creating
>> the connection and the rst.. Based on your comments, I was wondering
>> if that is resource cost efficient or if I´d be better off manually
>> creating the conn and the rst every time I need them.
>>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
.
- Follow-Ups:
- Re: Problem with Response.Request()
- From: Bob Barrows [MVP]
- Re: Problem with Response.Request()
- References:
- Problem with Response.Request()
- From: Marc Llenas
- Re: Problem with Response.Request()
- From: Bob Barrows [MVP]
- Problem with Response.Request()
- Prev by Date: Re: Bizarre error causes update of one record to update ALL records
- Next by Date: Re: Problem with Response.Request()
- Previous by thread: Re: Problem with Response.Request()
- Next by thread: Re: Problem with Response.Request()
- Index(es):
Relevant Pages
|