MySQL Forums
Forum List  »  General

Problems Updating data
Posted by: Tim James
Date: March 14, 2005 05:50AM

Hi, i am new to MySQL and am trying to create an ASP front to the database.

i have written some code and it seems to work fine although the database will not update. i have checked the different permissions to the database and tables but yet still no luck.

here is my code. so i am hoping that someone will have some ideas as to what is stopping the table from being updated?

<%

<!-- #INCLUDE file="updateCDetails.inc" -->

'on error resume next

dim adoConn

dim adoRS

dim strQ

dim lngRecordNo ' holds the record to be updated

lngRecordNo = Clng(Request.Form("clientId"))

set adoConn = Server.CreateObject("ADODB.Connection")

set adoRS = Server.CreateObject("ADODB.Recordset")

'adoConn.Open "DSN=mysql_dsn"

adoConn.Open "Driver=" & dbDriver & "; Database=" & dbDatabase & "; Uid=" & dbUser & ";Pwd=" & dbPassword & ";"


if adoConn.errors.count = 0 then

response.write "Connected Successfully!</br></br>"

end if

strQ = "UPDATE client_details SET"
strQ = strQ &"clientFirstName='" & Request.Form("FirstName") & "',"
strQ = strQ &"clientSecondName='" & Request.Form("SurName") & "',"
strQ = strQ &"clientAddress1='" & Request.Form("address1") & "',"
strQ = strQ &"clientAddress2='" & Request.Form("address2") & "',"
strQ = strQ &"clientAddress3='" & Request.Form("address3") & "',"
strQ = strQ &"clientPostCode='" & Request.Form("postcode") & "',"
strQ = strQ &"clientEmailAddress='" & Request.Form("emailAddress") & "',"
strQ = strQ &"clientPhoneMain='" & Request.Form("mainPhone") & "',"
strQ = strQ &"clientPhoneMobile='" & Request.Form("mobilePhone") & "',"
strQ = strQ &"clientGender='" & Request.Form("gender") & "',"
strQ = strQ &"clientPassword='" & Request.Form("Password") & "',"
strQ = strQ &"clientPassword2='" & Request.Form("Password2") & "'"
strQ = strQ &"WHERE clientId='" & lngRecordNo & "';"

on error resume next
adoConn.Execute strQ
if err<>0 then
response.write("No update permissions!<br /><br /><br />")
else
response.write("Record " & lngRecordNo & " was updated!")
end if

response.write(adoconn.Mode&"<br /><br /><br />")


adoconn.close


response.Write(strQ)
response.write("<br /><br />")
response.Write("<a href=""index.html"">Index</a>")
response.End()

'Response.Redirect "index.html"

%>

Options: ReplyQuote


Subject
Written By
Posted
Problems Updating data
March 14, 2005 05:50AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.