all groups > inetserver asp db > october 2007 >
You're in the

inetserver asp db

group:

updating information to database


updating information to database navin
10/6/2007 11:45:05 AM
inetserver asp db: Hi All,

i have page which shows supplier information in a table format.


Supplier Name Contact Email
AAA xxxxx xxxxxxx


In order to change or update information for the supplier, i want to
display supplier name in the table cell as a link.


so if user clicks on the link with the supplier name, it should take
the user to another page (suplier update page) where it should
display
the supplier information in text boxes. if users wants they can then
change information and update it into database.


Could anyone please tell me how to do the abve.


If anybody has any other idea to update the information in database,
please share.


Appreciate any ideas on this.


thanks,


Navin
Re: updating information to database Bob Barrows [MVP]
10/6/2007 3:17:52 PM
[quoted text, click to view]
I would suggest you give Eli Robillard's GenericDb a try. Although the
version I used a few years ago didn't exactly follow best practices, perhaps
he's updated it since then, and, even if he hasn't, studying the code should
give you an idea about how this is done.
http://www.genericdb.com/

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: updating information to database Adrienne Boswell
10/9/2007 3:00:20 PM
Gazing into my crystal ball I observed navin <navin.narayana@gmail.com>
writing in news:1191696305.305459.180630@o3g2000hsb.googlegroups.com:

[quoted text, click to view]

<td><a href="update.asp?supplier=<%=id%>" title="Update this record">AAA
</a></td>
[quoted text, click to view]

sql = "SELECT fields FROM table WHERE id = " & request.querystring("id")
'open up recordset, assign values, eg: name = rs("name")

if request.servervariables("REQUEST_METHOD") = "POST" then
if request.form("name") <> "" then
update = "UPDATE table SET field = '" & request.form("name")
& "' WHERE id = " & request.form("id")
'execute statement
'maybe take the user back to the original page
else
'give the user some sort of message
end if
end if
%>
<form method="post" action="<%=request.servervariables
("SCRIPT_NAME")%>">
<fieldset><legend>Update Information</legend>
<label for="name">Name: </label> <input type="text" name="name"
id="name" value="<%=name%>">
<p><input type="hidden" name="id" value="<%=request.querystring
("id")%>">
<input type="submit" value="Update Record"></p>
</fieldset>
</form>

[quoted text, click to view]

See above... you can do a lot more, create functions, etc.

[quoted text, click to view]

HTH


--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
AddThis Social Bookmark Button