Data in Access database changed when display in website

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Data in Access database changed when display in website

    Hi Everyone,
    I am trying to figure why the data of an Access database changed when
    displayed in a web-based administrative tool. The column data type is
    Memo, since text can't hold the length of the data. The data itself is
    a code of a page (this is sort of small content mangement system.)

    Here's the code that displays the data:
    Sub DisplayPageDetails()
    If Request("Task") = "DisplayPageDetails" Then
    dim cn, rs
    set cn = Server.CreateObject("ADODB.Connection")
    set rs = Server.CreateObject("ADODB.Recordset")
    cn.Open "DSN=Webdata;"
    rs.Open "SELECT * FROM Body Where Body.Title =
    '"&Request("Title")&"'",cn
    %>
    <p>
    <%If rs.EOF<>True or rs.BOF<> True Then%>
    <form name="Modify"
    action="adminPage.asp?Task=UpdatePageForm&Title=<% =rs("Title")%>"
    method="post">
    <p><b>HBGary Website Detail</b><br>
    Title:
    <input type="textbox" size="15" value="<%=rs("Title")%> "
    name="Title"><br>
    Content:<br>
    <textarea name="content" rows="50" cols="100"
    value="<%=rs("content")%>"> </textarea><br>
    Right Bar:<br>
    Create Date: <%=rs("CreateDate")%><input type="hidden" name="CreateDate"
    value="<%=rs("CreateDate")%>">&nbsp;
    Modified Date:
    <%Dim DateTime
    DateTime = Date()
    Response.Write(DateTime)%>
    <input type="hidden" name="ModifyDate" value="<%=DateTime%>"><br>
    </select>
    </p>
    <input type="submit" name="submit" value="Edit">
    </form>
    <%Else%>
    No record found.
    <%End If%>
    <%Set rs=Nothing %>
    </p>
    <%End If
    End Sub


    Now here's the code to update the data:
    Sub UpdatePageForm()
    Response.Write(" ")
    MyQry=" Update Body Set "&_
    "Title = '" & clean(Request("Title")) & "', "&_
    "content = '" & clean(Request("content")) & "'"
    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open MyQry, "DSN=Webdata;"
    <p>The record has been updated.</b></p>
    Set rs=Nothing
    End Sub%>

    Can anyobne tell me where I did wrong here? Thanks for your help.



    P. Rifai

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Primadona Rifai Guest

  2. Similar Questions and Discussions

    1. i want to display all the data in the database to the text field
      Well, I have 5 data in the database list(gDatabase), i want to display them all on the member("datafield").. when I used the repeat function, it...
    2. Help Outputting data from Access database
      I need to outputa grouped set of data from an Access database using CF. Basically a Person can be associated to many positions, programs and...
    3. entering data into MS Access database
      Hello, I'm creating an online survey using XHTML -- no PHP -- where the data will be entering into a MS Access database, and I am having trouble...
    4. securing data access via website
      I would like to use anonymous access for a public access, Win2k/IIS website. The database, however, should be accessed via a secured,...
    5. Display data from database in a scrollable data grid on an ASP Page
      Hi All, I want to display data from database in a scrollable data grid on an ASP Page. I want to use it for entering data also. Should i have to...
  3. #2

    Default Re: Data in Access database changed when display in website

    > <textarea name="content" rows="50" cols="100"
    > value="<%=rs("content")%>"> </textarea>
    Textarea doesn't have a "value" attribute. Try:

    <textarea name=content rows=50 cols=100>
    <%=server.htmlEncode(rs("content"))%>
    </textarea>


    Aaron Bertrand - MVP Guest

  4. #3

    Default Re: Data in Access database changed when display in website

    Thanks Aaron! I appreciate your help, you're right, it does not have
    value.

    P. Rifai

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Primadona Rifai Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139