SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    May 2001
    Location
    Lake Mary FL
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ASP, SQL and Memo Field - HELP!

    I need help with the following SQL statement from my ASP page using VBScript.

    I understand the problem, I take the data form an HTML Scrolling Text Box and want to Update it to a Memo field, no problem right? Wrong, when the following SQL statement is executed it is not 1 continuous line of data because the Text Box can contain carriage returns, therefore the end of the statement is never reached, namely the closing quotes and closing parathesis.

    This statement does execute properly if I have no carriage returns in my text box. However, I am integrating with a application already doing this (it is complied so no source code) and need certian fields to have carriage returns.

    What can I do? I know that it can be done, but how!

    ' SQL Update a MEMO field
    Conn.Execute("Update myfile Set mynotes='"&nnotes&"'")

  2. #2
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What type of database are you connecting to? Access handles carrage returns automatically. Otherwise you might want to try something like -
    Code:
    strTextBox = Request.Form("textbox")
    strTextBox = Replace(strTextBox, vbcrlf, "<br>")
    Also, I am little confused by what you're trying to here -
    Code:
    ='"&nnotes&"'"
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  3. #3
    SitePoint Member
    Join Date
    May 2001
    Location
    Lake Mary FL
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Regarding Data File Type

    I am using a Visual FoxPro Data Table to hold the data.

    The statement ='"&nnotes&"'" is used to pass the information to SQL to be updated into the data table. All character data requires a single quote around it.

    notes='test' <- this is what SQL would see when the statement is passed through to the server. The additional quotes VB Script uses to build the statement.

  4. #4
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm a clueless with FoxPro. If you planning on viewing this data back through a Web browser, the code might help. If it is also going to other sources, you could create another function that does the opposite.
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  5. #5
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    ech @ foxpro, sorry no answer, it's screwing me up the **** too... Having a hell of a time connecting to it over a network *L*
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright


Bookmarks

Posting Permissions

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