Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. 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 Professional 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 December 4th, 2006, 12:44 AM
Registered User
 
Join Date: Nov 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Completely Stumped

I'm fairly competent with ASP/vbscript... But I cannot figure this one out for the life of me, please help!

In the SQLExpress database, I have a field set to "text". When I iterate it out to the web page with absolutely no formatting like <Table>, it outputs just fine. When I have a formatted page complete with css classes, the "text" feild will not iterate out. Likewise, I can set the feild to varchar(5000) but not varchar(MAX)???

Is there something I'm not getting? Is there something special about iterating out a "text" field from a SQLEXPRESS database?

 
Old December 4th, 2006, 01:11 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Post your 'problematic code' - sounds like a strange one, perhaps you are missing a closing " around a property inside an html tag. I have made this mistake before, its often the last thing we look for as it seems so unlikely.

BTW: Im shutting doem for the day in 30ish minutes

Wind is your friend
Matt
 
Old December 4th, 2006, 12:53 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You will have to better explain your situation.

Please let me know if my understanding is correct:
You are saying that you can read some text from a text field in your database, and display it in a web page as "raw" text - that is, without any HTML tags.
However, when you put it into an html page with all the typical tags and css you can't see the text in the browser.

Questions:
1 - what tags surround the text when it is output? Just the body tags, or???
2 - Can you see the text in the source of the browser when you invoke the "view source" menu choice?

If your text is contained in the source it is possible that your css is not showing the <div> it is contained in, or that the color of text for that <div> is the same color as your background.

Of course, there are many other possiblities, but this is NOT a problem with getting data out of a text field in a database table.

One other thing - what does it mean to "iterate it out to the web page". I have never seen iterate used in this way before.

Woody Z http://www.learntoprogramnow.com
 
Old December 5th, 2006, 03:04 AM
Registered User
 
Join Date: Nov 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for helping, here is a more detailed explanation...

Does NOT work: (essentially some formatting)
<table class="myClass">
<tr>
<td>
<%=rs("textfield")%>
</td>
</tr>
</table>

DOES work: (essentially no formatting)
<body>
<%=rs("textfield")%>
</body>

the "textfield" is from SQLExpress field type "text"

woodyz - To "iterate it out to the web page" is bad grammer to mean iterate from the database to the webpage. i.e.- Response.Write(rs("databasefield"))

Hope this helps and any help is of couse super-appreciated. Thanks.

 
Old December 5th, 2006, 09:54 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What are the settings in css for myClass?

When you say it "does not work" what do you mean?
Have you checked the SOURCE of the html in the browser to see if your text is there?

If you want to get to a speedy solution, please check these things.

Woody Z http://www.learntoprogramnow.com
 
Old December 5th, 2006, 02:15 PM
Registered User
 
Join Date: Nov 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The settings for myClass is just simply setting the font and font color. I've looked at the html source and there's just simple nothing where the text should be. When I change the field in the database to varchar(5000), the text shows up. Other than that, I made no other changes.

 
Old December 5th, 2006, 02:35 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay. So that indicates that in your code where you add the table elements is actually different in other ways than you are saying. In other words, it is a RED HERRING to think that it is the formatting or CSS that is causing the problem.

You need to track down the real problem, now.

First of all, do you have any "On Error Resume Next" in your code? If so, take it out so you can see any real errors that are happening.

You state that a datatype of text works in the one case (with no table tags) but not in the other (with table tags). But, it is not the tags that are making the difference, as you have already indicated. You have to figure out what is different between the two uses - you might be doing something slightly different that you haven't looked into yet because you were focusing in the wrong area.

You need to make a very minimal test for yourself and eliminate all the possiblities, one-by-one.

Woody Z
http://www.learntoprogramnow.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm stumped MadMutant BOOK: Beginning Access 2007 VBA ISBN: 978-0-470-04684-5 1 July 24th, 2008 05:29 PM
Stumped, need XSLT Help foobar XSLT 3 July 3rd, 2006 11:07 AM
Help - I'm Completely Stuck [email protected] ASP.NET 1.x and 2.0 Application Design 1 May 16th, 2006 10:12 AM
Help!! I am completely stuck... andrewba Classic ASP Components 5 May 12th, 2005 04:50 AM
This program has stumped me, help! :) c0mpgeeksportsfan JSP Basics 1 December 5th, 2004 01:31 AM





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