problem hyperlink in database results

P

PK Lowrey

I have a 64-character field in a Foxpro table which is
displayed in a database results (asp) page. The field
contains a URL. When sent to the browser, it is right
padded with spaces, which doesn't work. How can I trim
those spaces? Thanks.
 
P

PK

Thanks Mike,

I have, of course, trimmed the data string stored in the
table. However, the Frontpage script is returning the
string padded with spaces. Can you give me specific
instruction on how to trim the resulted string? Hyperlink
propertied show the link as "maplink?maplink='%3c%
25=FP_FieldURL(fp_rs,%22maplink%22)%25%3e'", without the
double quotes.
-----Original Message-----
Hi PK,

Enclose the result filed with trim(....)


--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
Need to have an Ad Banner that allow individual links?
http://www.websunlimited.com/order/Product/navigation/adba nner.htm
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible


"PK Lowrey" <[email protected]> wrote
in message news:[email protected]...
 
P

PK

Mike,

The actual code line generated in the ASP is:
<a href="maplink?maplink='<%=FP_FieldURL(fp_rs,"maplink")%
'" target="_top">

Perhaps that will give you a clue.
-----Original Message-----
Hi PK,

Enclose the result filed with trim(....)


--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
Need to have an Ad Banner that allow individual links?
http://www.websunlimited.com/order/Product/navigation/adba nner.htm
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible


"PK Lowrey" <[email protected]> wrote
in message news:[email protected]...
 
P

PK

Mike,

You can see the page result at:
http://www.tirg.org/countydata.asp?county=Coffee
-----Original Message-----
Hi PK,

Enclose the result filed with trim(....)


--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
Need to have an Ad Banner that allow individual links?
http://www.websunlimited.com/order/Product/navigation/adba nner.htm
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible


"PK Lowrey" <[email protected]> wrote
in message news:[email protected]...
 
J

Jim Buyens

Does your FoxPro table always contain the full 64 characters, or is it
variable width?

If it always contain the full 64 characters, that's where your extra spaces
are coming from.

I'm not at all familiar with SQL for FoxPro, but you probably need to do a
custom query such as:

SELECT trim([fieldContainingUrl]) as trimmedUrl, ...

and then use the trimemdURL field to create your URL.

--
Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
P

PK

Thanks Jim,

I expect, like you, that the spaces come from the under-
populated 64-character field.

A parameter is passed when the page is called:
http://www.tirg.org/countydata.asp?county=Coffee

The FP generated code for the results table is:

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

The field with the URL is maplink, and FP generate this
tag for the data:

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

How can I implement the trimming?
-----Original Message-----
Does your FoxPro table always contain the full 64 characters, or is it
variable width?

If it always contain the full 64 characters, that's where your extra spaces
are coming from.

I'm not at all familiar with SQL for FoxPro, but you probably need to do a
custom query such as:

SELECT trim([fieldContainingUrl]) as trimmedUrl, ...

and then use the trimemdURL field to create your URL.

--
Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------


I have a 64-character field in a Foxpro table which is
displayed in a database results (asp) page. The field
contains a URL. When sent to the browser, it is right
padded with spaces, which doesn't work. How can I trim
those spaces? Thanks.


.
 
J

Jim Buyens

If this were Access, I would say:

SELECT Trim([maplink]) as maptrim, * FROM tncounties WHERE (county =
'::county::'

and then use the maptrim field rather than the maplink field for
reporting. But I don't know if FoxPro supports the Trim function that
way.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------



PK said:
Thanks Jim,

I expect, like you, that the spaces come from the under-
populated 64-character field.

A parameter is passed when the page is called:
http://www.tirg.org/countydata.asp?county=Coffee

The FP generated code for the results table is:

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

The field with the URL is maplink, and FP generate this
tag for the data:

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

How can I implement the trimming?
-----Original Message-----
Does your FoxPro table always contain the full 64 characters, or is it
variable width?

If it always contain the full 64 characters, that's where your extra spaces
are coming from.

I'm not at all familiar with SQL for FoxPro, but you probably need to do a
custom query such as:

SELECT trim([fieldContainingUrl]) as trimmedUrl, ...

and then use the trimemdURL field to create your URL.

--
Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------


I have a 64-character field in a Foxpro table which is
displayed in a database results (asp) page. The field
contains a URL. When sent to the browser, it is right
padded with spaces, which doesn't work. How can I trim
those spaces? Thanks.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top