473,326 Members | 2,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Spaces

I have a problem with the following code :

Response.write rstContacts(1).Value

The above line prints "Andark Marine"

However the following only passes "Andark" and stops at
the space. How do I get over this ? Its the same with all
records.

Response.Write("<td align=center><a
ref=companycontacts.asp?Company=" & rstContacts(1).Value
& " target=_new><img src=images\contact.ico width=25
height=25 border=0></a></td>")

Thanks for our help
Mark

Jul 19 '05 #1
8 2595
Two things:
1. Use Chr(34) to put quotes around the href.
2. Use Server.UrlEncode to encode the link.

like this:

Response.Write("<td align=center><a
href="&Chr(34)&"companycontacts.asp?Company=" &
Server.UrlEncode(rstContacts(1).Value)&Chr(34)&
& " target=_new><img src=images\contact.ico width=25
height=25 border=0></a></td>")

If rst may contain nulls, then put urlencode into a function like this:

Function PrintEncoded(strValue)
If IsNull(strValue) Then
PrintEncoded = ""
Else
PrintEncoded = Server.UrlEncode(strValue)
End If
End Function

UrlEncode will give an error if it is given a null value.

Shailesh.

Mark Sippitt wrote:
I have a problem with the following code :

Response.write rstContacts(1).Value

The above line prints "Andark Marine"

However the following only passes "Andark" and stops at
the space. How do I get over this ? Its the same with all
records.

Response.Write("<td align=center><a
ref=companycontacts.asp?Company=" & rstContacts(1).Value
& " target=_new><img src=images\contact.ico width=25
height=25 border=0></a></td>")

Thanks for our help
Mark


Jul 19 '05 #2
Generally yo can't have spaces in a Querystring, parsing stops at the
space.(I've seen somewhere that Apache might tolerate it)
Mats
"Mark Sippitt" <ms******@hotmail.com> wrote in message news:<08****************************@phx.gbl>...
I have a problem with the following code :

Response.write rstContacts(1).Value

The above line prints "Andark Marine"

However the following only passes "Andark" and stops at
the space. How do I get over this ? Its the same with all
records.

Response.Write("<td align=center><a
ref=companycontacts.asp?Company=" & rstContacts(1).Value
& " target=_new><img src=images\contact.ico width=25
height=25 border=0></a></td>")

Thanks for our help
Mark

Jul 19 '05 #3
why use response.write to display a link which has zillion double quotes, to
put it in a more simple way do this:

end you asp tag
%>

<td align="center"><a href="contacts.asp?company=<%=rstContacts(1).Value %>"
target=_new><img src=images\contact.ico width=25
height=25 border=0></a></td>
<%
then restart your asp code here
%>

Vivek
"Mark Sippitt" <ms******@hotmail.com> wrote in message
news:08****************************@phx.gbl... I have a problem with the following code :

Response.write rstContacts(1).Value

The above line prints "Andark Marine"

However the following only passes "Andark" and stops at
the space. How do I get over this ? Its the same with all
records.

Response.Write("<td align=center><a
ref=companycontacts.asp?Company=" & rstContacts(1).Value
& " target=_new><img src=images\contact.ico width=25
height=25 border=0></a></td>")

Thanks for our help
Mark

Jul 19 '05 #4
Response.Write "<td align=""center"">" & _
"<a href=""companycontacts.asp?Company=" & _
rstContacts(1).Value & _
""" target=_new>" & _
"<img src=""images\contact.ico"" width=""25""
height=""25"" border=""0""></a></td>"

All I've done is add double quotes around the properties of your tags. The
result will be
<td align="center"><a href="companycontacts.asp?Company=Andark Marine"><img
src="images\contact.ico" width="25" height="25" border="0"></a></td>

I've never tried but I'm pretty sure an ico file isn't going to show up on
IE

"Mark Sippitt" <ms******@hotmail.com> wrote in message
news:08****************************@phx.gbl...
I have a problem with the following code :

Response.write rstContacts(1).Value

The above line prints "Andark Marine"

However the following only passes "Andark" and stops at
the space. How do I get over this ? Its the same with all
records.

Response.Write("<td align=center><a
ref=companycontacts.asp?Company=" & rstContacts(1).Value
& " target=_new><img src=images\contact.ico width=25
height=25 border=0></a></td>")

Thanks for our help
Mark

Jul 19 '05 #5
Vivek,

I think you will find that method also does not work unfortunately, but
agree with you about the clarity, without the complication of double
quotes...

Mark Sippitt MIAP
Senior Developer

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #6
It didnt work??

Vivek

"Mark Sippitt" <ms******@hotmail.com> wrote in message
news:eQ**************@tk2msftngp13.phx.gbl...
Vivek,

I think you will find that method also does not work unfortunately, but
agree with you about the clarity, without the complication of double
quotes...

Mark Sippitt MIAP
Senior Developer

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #7
Why wouldn't it work. I do that sort of thing all the time.
"Mark Sippitt" <ms******@hotmail.com> wrote in message
news:eQ**************@tk2msftngp13.phx.gbl...
Vivek,

I think you will find that method also does not work unfortunately, but
agree with you about the clarity, without the complication of double
quotes...

Mark Sippitt MIAP
Senior Developer

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #8
The parameter value should also be urlencoded

Response.Write "<td align=""center"">" & _
"<a href=""companycontacts.asp?Company=" & _
Server.URLEncode(rstContacts(1).Value) & _
""" target=_new>" & _
"<img src=""images\contact.ico"" width=""25""
height=""25"" border=""0""></a></td>"
--
Mark Schupp
--
Head of Development
Integrity eLearning
Online Learning Solutions Provider
ms*****@ielearning.com
http://www.ielearning.com
714.637.9480 x17
"Tom B" <sh*****@hotmail.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Response.Write "<td align=""center"">" & _
"<a href=""companycontacts.asp?Company=" & _
rstContacts(1).Value & _
""" target=_new>" & _
"<img src=""images\contact.ico"" width=""25""
height=""25"" border=""0""></a></td>"

All I've done is add double quotes around the properties of your tags. The result will be
<td align="center"><a href="companycontacts.asp?Company=Andark Marine"><img src="images\contact.ico" width="25" height="25" border="0"></a></td>

I've never tried but I'm pretty sure an ico file isn't going to show up on
IE

"Mark Sippitt" <ms******@hotmail.com> wrote in message
news:08****************************@phx.gbl...
I have a problem with the following code :

Response.write rstContacts(1).Value

The above line prints "Andark Marine"

However the following only passes "Andark" and stops at
the space. How do I get over this ? Its the same with all
records.

Response.Write("<td align=center><a
ref=companycontacts.asp?Company=" & rstContacts(1).Value
& " target=_new><img src=images\contact.ico width=25
height=25 border=0></a></td>")

Thanks for our help
Mark


Jul 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Michael Bulatovich | last post by:
I have a simple db to keep track of work/time/projects etc. It has two fields (column) named "start time" and "end time" WITH THE SPACES. I'm trying to do some automation to a form associated with...
11
by: gopal srinivasan | last post by:
Hi, I have a text like this - "This is a message containing tabs and white spaces" Now this text contains tabs and white spaces. I want remove the tabs and white...
9
by: Durgesh Sharma | last post by:
Hi All, Pleas help me .I am a starter as far as C Language is concerned . How can i Right Trim all the white spaces of a very long (2000 chars) Charecter string ( from the Right Side ) ? or how...
17
by: tommy | last post by:
Hi all, I' m adding strings to some fields in my table via Access. The strings sometimes have trailing spaces and I really need to have it that way, but Access truncates trailing spaces. How can...
135
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about...
3
by: Luke - eat.lemons | last post by:
Hi, Could someone tell me the correct quotation to get around spaces in paths for: Server.MapPath("\\server\share\spaces in name.mdb") I know its bad practice to use spaces but...
8
by: Joe Cool | last post by:
I need to map several columns of data from one database to another where the data contains multiple spaces (once occurance of a variable number or spaces) that I need to replace with a single...
3
by: bstjean | last post by:
Hi everyone, I am trying to find an efficient way to perform a special query. Let me explain what I want. Let's say we are looking for all description that match "this is the target". In...
5
by: brian.j.parker | last post by:
Hey all, I've noticed an obscure little quirk: it appears that if you use a login with trailing spaces on the name, SYSTEM_USER automatically trims those trailing spaces in SQL Server 2000, but not...
8
by: drjay1627 | last post by:
hello, This is my 1st post here! *welcome drjay* Thanks! I look answering questions and getting answers to other! Now that we got that out of the way. I'm trying to read in a string and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.