SELECT LIKE statement with variable problem

SELECT LIKE statement with variable problem

am 09.01.2005 10:26:52 von Marco Krechting

Hi All,

I have a search form that uses the following query:
strSQL = "Select * From [SID_Master_Archief] Where [document_link] LIKE " &
"'%" & strString & "%'" & " ORDER BY [document_link]"

The value of strString is entered through like:

If Request.Form("txtString") <> "" Then
strString = Request.Form("txtString")
End If

This works fine for the first page. But when I click on Next to goto page 2
the strString = '' so it will automatically
display ALL the records in the table.

How can I make sure that the value of strString gets remembered even when
the page is reloaded for displaying the rest of the records?

Marco

Re: SELECT LIKE statement with variable problem

am 09.01.2005 10:34:45 von exjxw.hannivoort

Marco Krechting wrote on 09 jan 2005 in
microsoft.public.inetserver.asp.db:

> How can I make sure that the value of strString gets remembered even
> when the page is reloaded for displaying the rest of the records?
>

In a session variable?

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Re: SELECT LIKE statement with variable problem

am 09.01.2005 10:45:20 von Marco Krechting

Can you show me how to do this?

Marco

"Evertjan." wrote in message
news:Xns95D96BA0C7A75eejj99@194.109.133.29...
> Marco Krechting wrote on 09 jan 2005 in
> microsoft.public.inetserver.asp.db:
>
>> How can I make sure that the value of strString gets remembered even
>> when the page is reloaded for displaying the rest of the records?
>>
>
> In a session variable?
>
> --
> Evertjan.
> The Netherlands.
> (Replace all crosses with dots in my emailaddress)
>

Re: SELECT LIKE statement with variable problem

am 10.01.2005 22:22:39 von JohnDpatriot

Marco Krechting wrote:

> Can you show me how to do this?
>
> Marco
>
> "Evertjan." wrote in message
> news:Xns95D96BA0C7A75eejj99@194.109.133.29...
>
>>Marco Krechting wrote on 09 jan 2005 in
>>microsoft.public.inetserver.asp.db:
>>
>>
>>>How can I make sure that the value of strString gets remembered even
>>>when the page is reloaded for displaying the rest of the records?
>>>
>>
>>In a session variable?
>>
>>--
>>Evertjan.
>>The Netherlands.
>>(Replace all crosses with dots in my emailaddress)
>>
>
>
>

A session variable can only be set server side and thus must be set be
fore the user has a chance to interact with the page. You set it at the
server as follows:
<%
session("Page")="Page1.asp"
%>

on the following page you can recall if as a regular variable, but again
only Server side.

<%
sql="select * from blah where page=" + session("Page")
%>

Re: SELECT LIKE statement with variable problem

am 11.01.2005 13:16:58 von exjxw.hannivoort

JohnDpatriot wrote on 10 jan 2005 in microsoft.public.inetserver.asp.db:

> A session variable can only be set server side and thus must be set be
> fore the user has a chance to interact with the page. You set it at
> the server as follows:
> <%
> session("Page")="Page1.asp"
> %>

Yes, but:

You can re-enter the [same] page and it feels like a clientside action,
if the reload is not to time intensive.

see below.


> on the following page you can recall it as a regular variable, but
> again only Server side.
>
> <%
> sql="select * from blah where page=" + session("Page")
> %>

yes, but try test1.asp:



=====================

re-entry, try test2.asp:

<%
if request.querystring("my")<>"" then
session("myString") = request.querystring("my")
end if
%>








--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)