Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 14th, 2004, 08:11 AM
Registered User
 
Join Date: Feb 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default response.write spacing

Hi,

The following code actually works perfectly, writing a name from a database with the email address and web page if there is one, but writes a new single character space at the start of each line. As it loops, this moves each successive line in to the right by a smidge. Which looks weird. Anyone know a way round this?

If not objRS.eof then
do while not objRS.eof
  For each fldF in objrs.Fields
   If len(fldF.value) > 0 then
        If inStr(fldF.Value, "www.") > 0 then
response.write "<TABLE BORDER=0 cellpadding=0 cellspacing=2><tr><td width=500><a target='_blank' href='http://" & fldF.value & "'>" & fldF.value & "</a>"
         ElseIf inStr(fldF.Value, "@") > 0 then
response.write "<TABLE BORDER=0 cellpadding=0 cellspacing=2><tr><td width=500><a href='mailto:" & fldF.value & "'>" & fldF.value & "</a>"
         Else
response.write "<TABLE BORDER=0 cellpadding=0 cellspacing=2><tr><td width=500>" & fldF.value
         End if
    End if
    next
response.write "</tr></td></TABLE>"
objRS.movenext
loop
End If
objRS.Close
Set objRS = Nothing
End If

Thanks! and if I should have found the answer in a earlier post, I apologise, but I don't find it easy to search this site now it's got so big.

Maggie


 
Old October 16th, 2004, 12:43 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Can you copy/paste the output of this code, so as to understand that better?

_________________________
- Vijay G
Strive for Perfection
 
Old October 16th, 2004, 12:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

I think your problem is this line:
response.write "</tr></td></TABLE>"
it should probably read:
response.write "</td></tr></TABLE>"






Similar Threads
Thread Thread Starter Forum Replies Last Post
Response.Write doesn't work? Ron Howerton Pro JSP 1 March 27th, 2007 02:03 AM
response.write(hyperlink) adolphus ASP.NET 1.0 and 1.1 Basics 7 September 11th, 2006 03:05 AM
response.write crmpicco Classic ASP Basics 1 January 27th, 2005 06:31 PM
response.write netcrawler Classic ASP Databases 4 September 29th, 2004 10:13 AM
Response.write Sach Classic ASP Components 5 March 19th, 2004 06:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.