|
|
|
|
|
| | |
|
Active Server Pages ASP ASP.NET .aspx .ascx Web HTML Developer Internet Microsoft Web Services Visual Studio .NET CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
The "&" sign in a field is cause script errors |
From: |
Cheryl |
Date: |
2/27/1999 8:37:05 PM |
IP: |
206.180.128.247 |
I've got a modified script courtesy of http://www.activeserverpages.com. It displays the listings of a database in a table along with a link to view the entire record. (This is retrieving records from an Access database.)
Here is the script:
<table border="1">
<tr>
<td valign="top"> </td>
<% 'Put Headings On The Table of Field Names
for i=0 to howmanyfields %>
<td><b><%=rstemp(i).name %></b></td>
<% next %>
</tr>
<% ' Now lets grab all the records
do while not rstemp.eof %>
<tr><td valign="top">
<%my_link=scriptresponder & "?which=" & rstemp(idfield)%>
<a HREF="<%=my_link%>">View</a></td>
<% for i = 0 to howmanyfields%>
<td valign="top"><%=rstemp(i)%></td>
<% next %>
</tr>
<%
rstemp.movenext
loop
rstemp.close
set rstemp=nothing
conntemp.close
set conntemp=nothing
%>
</table>
The field the View link targets is the Company name. Works fine except where there's an &. It cuts off the field after that and so won't display the record.
Is there a line (maybe an if/then) I can use to make & = char(26) or & = &
I could do a search/replace in the database to change & to and, but since these are company names, I'd prefer not to.
TIA
--Cheryl |
Follow Up - Re: The - Harlan 3/1/1999 2:16:21 PM
|
|

|
|
|
|
|
|
|
|
|
|