Ask a Question related to ASP Database, Design and Development.
-
Primadona Rifai #1
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")%>">
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
-
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... -
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... -
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... -
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,... -
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... -
Aaron Bertrand - MVP #2
Re: Data in Access database changed when display in website
> <textarea name="content" rows="50" cols="100"
Textarea doesn't have a "value" attribute. Try:> value="<%=rs("content")%>"> </textarea>
<textarea name=content rows=50 cols=100>
<%=server.htmlEncode(rs("content"))%>
</textarea>
Aaron Bertrand - MVP Guest
-
Primadona Rifai #3
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



Reply With Quote

