Re: Problem with Response.Request()

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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.
>
>


.



Relevant Pages

  • Re: Updating Access data using SQL / refresh time question
    ... As a test today, for one poarticular recordset, I changed from DAO to ADO to ... > I forgot to mention that the expense of repeated connection open and close ... > dim oconn as new adodb.connection ... > 'Now load the listview by looping through each RS row ...
    (microsoft.public.vb.database)
  • Re: Updating Access data using SQL / refresh time question
    ... > I forgot to mention that the expense of repeated connection open and close ... > dim oconn as new adodb.connection ... > 'Now load the listview by looping through each RS row ... > ' Set the recordset object each time we load the listview ...
    (microsoft.public.vb.database)
  • Re: extract data from sqlplus into excel sheet
    ... Range.CopyFromRecirdset rst ... populate a recordset from running a query against the connection ... 'CREATE AND POPULATE THE RECORDSET ...
    (microsoft.public.excel.programming)
  • Re: Problem: MDB-Datenbank Zugriff über das Intranet
    ... Wie und wo öffnest Du Deine Connection zur *.mdb? ... > End With ... Du öffnest ein Recordset mit adOpenForwardOnly. ... Datensatz liegenden Datensatz zuzugreifen. ...
    (microsoft.public.de.vb.datenbank)
  • Re: ASP - FROM statement slows down connection to database
    ... Open your database in Access, switch to the Queries tab, create a new query ... in Design View without choosing a table, swtich to SQL View, paste the sql ... connection string rather than using an ... recordset open statements. ...
    (microsoft.public.inetserver.asp.db)