Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi, I've just been reading this thread - 3 years later! I am trying to include your solution to restricting the amount of characters returned in a query. I use MS Access as my database and wonder if this is why I can't get the code to work? I get the following response:

    Code:
    # Error Type:
    Microsoft VBScript compilation (0x800A03EE)
    Expected ')'
    /soundplay/Templates/testPage.asp, line 559, column 69
    response.write(server.HTMLEncode(rsRelatedText.Fields("featureText"))
    --------------------------------------------------------------------^
    
    
    The code I'm using is as follows:
    
    This is at the beginning of my .asp page - before the head section
    
    <%
    Dim rsRelatedText
    Dim rsRelatedText_numRows
    
    limit = 50
    
    Set rsRelatedText = Server.CreateObject("ADODB.Recordset")
    rsRelatedText.ActiveConnection = connSpMain
    rsRelatedText.Source = "SELECT featureText  FROM tblPages  WHERE section = 'home' AND categoryLink <> 'index'"
    rsRelatedText.CursorType = 0
    rsRelatedText.CursorLocation = 2
    rsRelatedText.LockType = 1
    rsRelatedText.Open()
    
    rsRelatedText_numRows = 0
    %>
    
    
    
    And then I have this in the body of the .asp page:
    
    
    <%=(rsRelatedText.Fields.Item("featureText").Value)%>
    <%
    If Len(rsRelatedText.Fields("featureText")) > limit then  
      	response.write(server.HTMLEncode(Left(rsRelatedText.Fields("featureText"), limit)) & "...")   'HTMLEncode to display the text as text and not HTML code
    else
    	response.write(server.HTMLEncode(rsRelatedText.Fields("featureText"))
    end if
    %>
    Can anyone still help with this issue?

    In anticipation,

    Marconi.
    Last edited by guelphdad; 09-07-2006 at 04:42 AM.

  • #2
    Regular Coder
    Join Date
    Jan 2003
    Posts
    867
    Thanks
    4
    Thanked 8 Times in 8 Posts
    As the error message indicates, you are missing an end parenthesis.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •