Reply
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
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 09-21-2009, 02:49 PM Re: Error when returning string to page. HELP PLEASE!!!
chrishirst's Avatar
Super Moderator

Posts: 22,221
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!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
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: 73
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)
itHighway is offline
Reply With Quote
View Public Profile
 
Reply     « 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.11427 seconds with 13 queries