AllExperts > Active Server Pages Programming (ASP) 
Search      
Active Server Pages Programming (ASP)
Volunteer
Answers to thousands of questions
 Home · More Active Server Pages Programming (ASP) Questions · Answer Library  · Encyclopedia ·
More Active Server Pages Programming (ASP) Answers
Question Library

Ask a question about Active Server Pages Programming (ASP)
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Ashley Brazier
Expertise
Main focus is ASP, SQL Server 2000 & 2005

Experience
Over 6 years experience.

Education/Credentials
BCs Honours Software Design and Networks

 
   

You are here:  Experts > Computing/Technology > Business Software > Active Server Pages Programming (ASP) > asp update

Active Server Pages Programming (ASP) - asp update


Expert: Ashley Brazier - 7/16/2008

Question
QUESTION: Hi! my update code runs and executes but does not update the database, can u please help.
<%
sSQL = "SELECT * FROM Detail where User='" & Request("User") &"'"
  Set oRS = oConn.Execute(sSQL)
         If Request("Submit") = "update" Then
       sSQL = " update Detail SET"
       sSQL = sSQL &  "Equipment = '"& Request("Equipment") & "',"
       sSQL = sSQL &  "User = '"& Request("User")  & "',"
       sSQL = sSQL &  "Manufacturer = '"& Request("Manufacturer")  & "',"
     sSQL = sSQL &  "Model= '"& Request("Model")  & "',"
     sSQL = sSQL &  "CPU = '"& Request("CPU")  & "',"
     sSQL = sSQL &  "VGACard = '"& Request("VGACard")  & "',"
     sSQL = sSQL &  "Office = '"& Request("Office")  & "',"
      sSQL = sSQL &  "RAM = '"& Request("RAM")  & "',"
       sSQL = sSQL &  "HardDisk = '"& Request("HardDisk")  & "'"
       sSQL = sSQL &  "WHERE User = '"& Request("User") & "'"

  oConn.Execute (sSQL)

  Response.Write "Details of  <b>" & Request("User") & "</b> has been successfully updated<br>"
end if
oRS.Close
oConn.Close
Set oRS = Nothing
Set oConn = Nothing
%>

ANSWER: trying  putting

response.write ssql
response.end()

before oConn.Execute (sSQL)
then send me what it prints out.

---------- FOLLOW-UP ----------

QUESTION: It does not print out anything, the code executes but the database is not updated.

Answer
if that didn't print anything out then there is something wrong with
  If Request("Submit") = "update" Then

Check what value Request("Submit") is print by doing this before the
  If Request("Submit") = "update" Then


response.write Request("Submit")  

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.