Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Updating a database using SQL UPDATE command

Author  Topic 

marshallw
Starting Member

2 Posts

Posted - 2009-07-23 : 16:53:42
Ok, so I am new to this game, and am trying to set up a simple database reference on my companies intranet. I have been able to sort and retrieve the data fine. I am now trying to have an option for users to update certain fields on the page and have it update the database. I have read several articles on this and I am confused. I know this command is used to update a database field

UPDATE FFSHDevices SET Device= 1

But I dont really understand how to implement it. I am using Dreamweaver, but programming the SQL myself becuase I couldn't get Dreamweaver's damn built in database stuff to work. Here is my code:

<%Set recordSet = Server.CreateObject("ADODB.Recordset")%>

<%recordSet.Open "SELECT * FROM FFSHDevices WHERE PkgType = '" & Request.QueryString("PkgType") &_
"' AND Pkg = '" & Request.QueryString("Pkg") &_
"' AND Pins = '" & Request.QueryString("Pins") & "'",connectionToDatabase,3%>

<%Response.Write recordSet("Temp")%>


Say initially the Temp field for that query returns 'COLD'. I would like to have a text box where a user could type in 'HOT', and submit it. Then it changes that specific value in the database, and the page reloads with that value now at 'HOT'.

Any experts out there that can walk me through this?

Thanks!

marshallw
Starting Member

2 Posts

Posted - 2009-07-24 : 09:16:57
any help?
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-07-24 : 10:05:58
have a look at these...let me know if it helps.

http://www.webdeveloper.com/forum/showthread.php?t=128156

http://www.webdeveloper.com/forum/showthread.php?t=134353
Go to Top of Page
   

- Advertisement -