Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Closed Thread
Error when returning string to page. HELP PLEASE!!!
Old 09-21-2009, 02:25 PM Error when returning string to page. HELP PLEASE!!!
Novice Talker

Posts: 8
Name: Greg
Trades: 0
Hi,

Im trying to display text on an asp page as it was entered into an SQL 2000 DB. I was loosing the shape so i tried this method of relaying it on the page.

Any ideas... See below for text


<%
Dim sText = (recordset1.Fields.Item("MainBody").Value)
sText = Replace(sText, vblf, "<br/>")
%>

but am getting this error

Microsoft VBScript compilation error '800a0401'

Expected end of statement
/test/test.asp, line 309 Dim sText = (recordset1.Fields.Item("MainBody").Value)----------^
The Mighty Dub is offline
View Public Profile
 
 
Register now for full access!
Old 09-21-2009, 02:49 PM Re: Error when returning string to page. HELP PLEASE!!!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,516
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You cannot DIMension and set a variable in a single statement in vBScript.

use a colon to seperate the statements.

Code:
dim sText : sText = recordset1.Fields.Item("MainBody").Value
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
View Public Profile Visit chrishirst's homepage!
 
Old 09-21-2009, 04:32 PM Re: Error when returning string to page. HELP PLEASE!!!
itHighway's Avatar
Skilled Talker

Posts: 83
Name: Zeeshan Dar
Location: GUJ
Trades: 0
Try following:

Quote:

dim sText : sText = recordset1.Fields.Item("MainBody").Value
sText = Replace (sText&"", Chr(13), "<br>", 1, -1, 0)
__________________
Zeeshan Dar
itHighway -
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
itHighway is offline
View Public Profile
 
Closed Thread     « Reply to Error when returning string to page. HELP PLEASE!!!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11557 seconds with 12 queries