Use a textarea to edit and update Access record

vzdog
vzdog used Ask the Experts™
on
Hello all. I am trying to follow the example on the w3schools site to update a database record in Access. With, 1 slightly different way. I want to use a textarea only to do this.
What I am trying to do is provide a single location for a "Message of the Day" to be updated as the boss decides to. The messages will not be stored in the Access db other than the current one, and my in tent is the can access it and the overwrite the existing then just save it.

I appreciate all input.

My code is based on http://www.w3schools.com/ado/ado_demo.asp
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Wayne BarronAuthor, Web Developer
Top Expert 2009

Commented:
Helllo
This will show you how to update the field with a TextField.
This will also show you how to seperate the linebreaks and how to compile
Through without error inserting single Quotes (Replacing with Double Quotes)
Plus some more goodies.

http://ee.cffcs.com/Q_24580137/Q_24580137.asp?id=1
code
http://ee.cffcs.com/Q_24580137/Q_24580137.zip

If you have any questions, let me know

Carrzkiss

Author

Commented:
carrzkiss - thanks for the reply. Just getting back in and will look through this morning as soon as I can.
I of course will accept as solution if applicable. Thanks!

Author

Commented:
Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression 'id='.
Q_24580137.asp, line 11

Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Author

Commented:
I still have recieved a solution for this issue.
As I stated in my initial post , My code is based on http://www.w3schools.com/ado/ado_demo.asp.

I can get this all to work fine, except for when I am trying to allow the user to edit the message. The message is written out in a text box,  which makes it hard to read. I would like to have it displayed in a textarea.
I am attaching the code I am using for the edit page and the submit page, in hopes someone can tell me how to properly utilize a textarea - that will allow a user to update the field through the submit button.
<!-- Edit.asp-->
 
<form method="post" action="ExecSub.asp">
<input name="no" type="hidden" value=<%=no%>>
<table bgcolor="#b0c4de">
<%
for each x in rs.Fields
      if x.name <> "no" and x.name <> "dateadded" then%>
           <tr>
           <td><%=x.name%> </td>
	   <td><input name="<%=x.name%>" value="<%=x.value%>"></td>
	   
	   
	 <%end if
next
 
rs.close
conn.close
%>
</tr>
</table>
<br />
<input type="submit" name="action" value="Save">
</form>
 
<!--Submit.asp-->
 
if Request.form("action")="Save" then
      no=Request.Form("no")
      sql="UPDATE tblExecMsg SET "
      sql=sql & "message='" & Request.Form("message") & "'"
      sql=sql & "WHERE tblExecMsg.[no]=" & no
'on error resume next
conn.Execute sql, Recordsaffected
 
conn.close
set conn = nothing
set sql = nothing 
end if 
Response.Redirect"ExecMsg.asp"
%>

Open in new window

Author, Web Developer
Top Expert 2009
Commented:
vzdog

did you not pay attention to the url demo that I have posted?
http://ee.cffcs.com/Q_24580137/Q_24580137.asp?id=1

The querystring at the end of it tells the query what record to pull and show to you.

Make sure that you run it on your site exactly as I have it here,

Q_24580137.asp?id=1
with the    ?id=1

Author

Commented:
Carrzkiss - I got it Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial