vPath cutting off path location name?

vPath cutting off path location name?

am 14.06.2007 01:41:08 von zz12

Hello. We have a SearchResults.asp page that returns a list of asp pages
that are associated with the user's search parameters that they type in in a
search page called something like Search.asp. We noticed that the last line
in the following rs("vpath") value lists the path up until the first blank
of either a folder or file name and cuts off the rest of the path's text
name. Does anyone know how to have the vpath list the entire path name even
including spaces if there are any?

<%
Dim sSearchString
Dim oQuery

sSearchString = Request.Form("query")

Const SEARCH_CATALOG = "web" 'remember to change this

Set oQuery = Server.CreateObject("IXSSO.Query")
oQuery.Catalog = SEARCH_CATALOG
oQuery.Query = "@all " & sSearchString & " AND NOT #path *_* AND NOT #path
*downloads* AND NOT #path *images* AND NOT #filename *.class AND NOT
#filename *.asa AND NOT #filename *.css AND NOT #filename *postinfo.html"
oQuery.MaxRecords = 200
oQuery.SortBy = "rank[d]"
oQuery.Columns = "DocAuthor, vpath, doctitle, FileName, Path, Write, Size,
Rank, Create, Characterization, DocCategory"
Set rs = oQuery.CreateRecordSet("nonsequential")

Response.write " style='arial'>" & rs("doctitle") & "
"
%>

Thanks in advance.

Re: vPath cutting off path location name?

am 14.06.2007 10:52:04 von Daniel Crichton

zz12 wrote on Wed, 13 Jun 2007 16:41:08 -0700:

> Hello. We have a SearchResults.asp page that returns a list of asp pages
> that are associated with the user's search parameters that they type in in
> a search page called something like Search.asp. We noticed that the last
> line in the following rs("vpath") value lists the path up until the first
> blank of either a folder or file name and cuts off the rest of the path's
> text name. Does anyone know how to have the vpath list the entire path
> name even including spaces if there are any?
>
> <%
> Dim sSearchString
> Dim oQuery
>
> sSearchString = Request.Form("query")
>
> Const SEARCH_CATALOG = "web" 'remember to change this
>
> Set oQuery = Server.CreateObject("IXSSO.Query")
> oQuery.Catalog = SEARCH_CATALOG
> oQuery.Query = "@all " & sSearchString & " AND NOT #path *_* AND NOT #path
> *downloads* AND NOT #path *images* AND NOT #filename *.class AND NOT
> #filename *.asa AND NOT #filename *.css AND NOT #filename *postinfo.html"
> oQuery.MaxRecords = 200
> oQuery.SortBy = "rank[d]"
> oQuery.Columns = "DocAuthor, vpath, doctitle, FileName, Path, Write, Size,
> Rank, Create, Characterization, DocCategory"
> Set rs = oQuery.CreateRecordSet("nonsequential")
>
> Response.write " > size='2' style='arial'>" & rs("doctitle") & "
"
> %>

You need to put quotes around the path, and I'd recommend URL encoding them
too. For completeness I'd also recommend HTML encoding doctitle just in case
there are any characters that might cause problems (however, if you know
this is already in HTML format you can remove the Server.HTMLEncode function
call)

Response.write " color='#49698D'
size='2' style='arial'>" & Server.HTMLEncode(rs("doctitle")) &
"

"

Notice the "" before and after the path value, this writes a " at those
positions

That should do it. The reason the path was being cut at the space is because
without the href value being quote the browser has to use spaces as the
attribute delimiters, eg.



the href value becomes "my", because "path" could be another attribute name.
If you had



then the browser will know that "my path" is the entire path. However,
spaces in URLs are not allowed, so you do this:



and everthing works properly. Server.URLEncode will do all the work of
ensuring that the vpath value is correctly presented for URL use, replacing
all non-legal chars with URL entities.

Dan

Re: vPath cutting off path location name?

am 14.06.2007 20:55:55 von zz12

That fixed it. You are awesome. Thanks a bunch Daniel. Much appreciated.

Take cares :)


"Daniel Crichton" wrote in message
news:OTxJJFmrHHA.2240@TK2MSFTNGP03.phx.gbl...
> zz12 wrote on Wed, 13 Jun 2007 16:41:08 -0700:
>
>> Hello. We have a SearchResults.asp page that returns a list of asp pages
>> that are associated with the user's search parameters that they type in
>> in
>> a search page called something like Search.asp. We noticed that the last
>> line in the following rs("vpath") value lists the path up until the first
>> blank of either a folder or file name and cuts off the rest of the path's
>> text name. Does anyone know how to have the vpath list the entire path
>> name even including spaces if there are any?
>>
>> <%
>> Dim sSearchString
>> Dim oQuery
>>
>> sSearchString = Request.Form("query")
>>
>> Const SEARCH_CATALOG = "web" 'remember to change this
>>
>> Set oQuery = Server.CreateObject("IXSSO.Query")
>> oQuery.Catalog = SEARCH_CATALOG
>> oQuery.Query = "@all " & sSearchString & " AND NOT #path *_* AND NOT
>> #path
>> *downloads* AND NOT #path *images* AND NOT #filename *.class AND NOT
>> #filename *.asa AND NOT #filename *.css AND NOT #filename *postinfo.html"
>> oQuery.MaxRecords = 200
>> oQuery.SortBy = "rank[d]"
>> oQuery.Columns = "DocAuthor, vpath, doctitle, FileName, Path, Write,
>> Size,
>> Rank, Create, Characterization, DocCategory"
>> Set rs = oQuery.CreateRecordSet("nonsequential")
>>
>> Response.write "
>> size='2' style='arial'>" & rs("doctitle") & "
"
>> %>
>
> You need to put quotes around the path, and I'd recommend URL encoding
> them too. For completeness I'd also recommend HTML encoding doctitle just
> in case there are any characters that might cause problems (however, if
> you know this is already in HTML format you can remove the
> Server.HTMLEncode function call)
>
> Response.write " > color='#49698D'
> size='2' style='arial'>" & Server.HTMLEncode(rs("doctitle")) &
> "

"
>
> Notice the "" before and after the path value, this writes a " at those
> positions
>
> That should do it. The reason the path was being cut at the space is
> because without the href value being quote the browser has to use spaces
> as the attribute delimiters, eg.
>
>
>
> the href value becomes "my", because "path" could be another attribute
> name. If you had
>
>

>
> then the browser will know that "my path" is the entire path. However,
> spaces in URLs are not allowed, so you do this:
>
>

>
> and everthing works properly. Server.URLEncode will do all the work of
> ensuring that the vpath value is correctly presented for URL use,
> replacing all non-legal chars with URL entities.
>
> Dan
>