Please help with ASP problem

P

PK

Browse http://www.tirg.org/countydata.asp?county=Hawkins
and you will find a hypertext link in a data results table
http://www.comptroller.state.tn.us/lg/map/lghawk.htm which
visibly appears workable.

However, when clicked
http://www.comptroller.state.tn.us/lg/map/lghawk.htm %
20%20%20%20%20%20%20%20%20%20 is requested, and obviously
doesn't work.

The appended spaces represent the difference in the length
of the URL string and the actual table field length.

Fronpage generate the following script fot the data
results table:

<%
fp_sQry="SELECT * FROM tncounties WHERE (county
= '::county::')"
fp_sDefault="county="
fp_sNoRecords="<tr><td colspan=2 align=""LEFT""
width=""100%"">No records returned.</td></tr>"
fp_sDataConn="TN-Counties"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="commelect"
fp_sMenuValue="commelect"
fp_sColTypes="&commelect=131&college=131&county=129&genbudg
et=131&govtemploy=131&highschool=131&hoteltax=131&household
s=131&income=131&landarea=131&maplink=129&population=131&po
verty=131&propertytx=131&regvoters=131&salestax=131&schbudg
et=131&seat=129&severancet=131&students=131&tnhouse=129&tnj
udiciar=129&tnsenate=129&under18=131&qualified=131&ushouse=
129&voted02=131&voted02epr=131&voted02rpr=131&wheeltax=131&
"
fp_iDisplayCols=2
fp_fCustomQuery=False
BOTID=4
fp_iRegion=BOTID
%>

Then this tag to display the hyperlink:

<a href="maplink?maplink='<%=rtrim(FP_FieldURL
(fp_rs,"maplink"))%>'" target="_top">

None of my trimming of strings has worked. I would very
much appreciate help in resolving this problem.

PK Lowrey,
TN Institute for Responsible Government
 
K

Kevin Spencer

What database are you using?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
P

PK

Data resides in a Foxpro dbase (.dbf) table.
-----Original Message-----
What database are you using?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.




.
 
K

Kevin Spencer

Hi PK,

Why are you using FP_FieldURL for the value? You want to edit your code and
create your own hyperlink. If it's a text field, just create your hyperlink
HTML around it, and use the Trim() function to trim it. I think maybe using
FP_FieldURL is at the root of your problem.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
P

PK

Thanks Kevin,

The FP_FieldURL function was not my choice. It was
generated by Frontpage.

Maplink is a text field, and I replaced the hyperlink as
follows:

<a href="<%=trim(maplink)%>" target="_top">

The problem persists. Could the trim() function not be
working?
 
K

Kevin Spencer

No, the Trim function works fine. However, I have no idea where you've
defined "maplink" as a variable name, which is how you're using it in your
code. Telling me that FP_FIeldURL was not your choice is a bit misleading.
FrontPage writes code, certainly, but based upon your answers to the
wizard's questions.

I don't know what to tell you at this point. I'll give it a shot, however.
Just forgive me if I fall short here. All I can tell you is that you have to
insert the value pulled from the database into the hyperlink, and that you
have to use the Trim() function to trim it. What I can't tell you is exactly
how to get that field data, as I'm no expert with the FrontPage DRW tools,
but only a lowly programmer. It looks to me like you answered at least one
wizard question wrong (to get a reference to FP_FieldURL in your code), and
that had to do with the field you want to Trim, so I can't tell you the
exact syntax you would want to use in this mixed code.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
J

Jon

Funnily enough I had a case just last week when trim wasn't removing
whitespace properly, got around with a little function
<%
function TrimEx(byval s)
dim re
set re = new regexp
re.pattern = "^\s+|\s+$"
re.ignorecase = true
re.global = true
TrimEx = re.replace(s, "")
set re = nothing
end function
%>
<%=TrimEx(" text ")%>

Might be worth a try...

Jon
Microsoft MVP - FP
 
P

PK

Thanks Jon,

I have tried this. It gives me an error at the function
statement: function TrimEx(byval s)

What is "byval s"?
 
Top