lynxvoodoo
Technical User
Hi! Once I login to my system using the appropriate username and password, it does pull the specific user records. The problem though is that the process does not seem to update the record and when I press on the continue, it simply displays the error message ("Sorry! Could not process your data. Please try again later."
.
If I change -->
If intAffected = 1 then TO If intAffected = 0 then
the page does continue but it displays the details of the last record within the database.
<!-- #include file="db.asp" -->
<%
'Get the users name passed from the previous page
strUserName = Request.QueryString("name"
%>
<%
firstname = Request("firstname"
lastname = Request("lastname"
address1 = Request("address1"
address2 = Request("address2"
town = Request("town"
postcode = Request("postcode"
phone = Request("phone"
country = Request("country"
email = Request("email"
'The following sql statement is used to insert new customer data into the database.
sqlAdd = "UPDATE customerdetails SET customerFirstName='"&firstname&"'," &_
" customerLastName='"&lastname&"', customerHomeAddress1='"&address1&"', customerHomeAddress2='"&address2&"', customerCity='"&town&"', customerPostCode='"&postcode&"', customerHomePhone="&phone&", customerCountry='"&country&"', customerEmailAddress='"&email&"' WHERE " &_
" customerUserName='"&strUserName&"'"
call openConn()
dbc.execute sqlAdd, intAffected
If intAffected = 1 then
sql = "SELECT max(customerID) from customerdetails"
set rs = dbc.execute(sql)
CustomID = rs(0)
call closeConn()
Session("cid"
= CustomID
Response.Redirect "checkout2.asp"
Else
call closeConn()
Response.Redirect "displayerrormsg.asp?msg=" & Server.URLEncode("Sorry! Could not process your data. Please try again later."
End If
%>
How can I get it to update the record and then display the correct info.
Please inform as to what can be done to resolve this problem.
Thanks in advance.
Lynx
If I change -->
If intAffected = 1 then TO If intAffected = 0 then
the page does continue but it displays the details of the last record within the database.
<!-- #include file="db.asp" -->
<%
'Get the users name passed from the previous page
strUserName = Request.QueryString("name"
%>
<%
firstname = Request("firstname"
lastname = Request("lastname"
address1 = Request("address1"
address2 = Request("address2"
town = Request("town"
postcode = Request("postcode"
phone = Request("phone"
country = Request("country"
email = Request("email"
'The following sql statement is used to insert new customer data into the database.
sqlAdd = "UPDATE customerdetails SET customerFirstName='"&firstname&"'," &_
" customerLastName='"&lastname&"', customerHomeAddress1='"&address1&"', customerHomeAddress2='"&address2&"', customerCity='"&town&"', customerPostCode='"&postcode&"', customerHomePhone="&phone&", customerCountry='"&country&"', customerEmailAddress='"&email&"' WHERE " &_
" customerUserName='"&strUserName&"'"
call openConn()
dbc.execute sqlAdd, intAffected
If intAffected = 1 then
sql = "SELECT max(customerID) from customerdetails"
set rs = dbc.execute(sql)
CustomID = rs(0)
call closeConn()
Session("cid"
Response.Redirect "checkout2.asp"
Else
call closeConn()
Response.Redirect "displayerrormsg.asp?msg=" & Server.URLEncode("Sorry! Could not process your data. Please try again later."
End If
%>
How can I get it to update the record and then display the correct info.
Please inform as to what can be done to resolve this problem.
Thanks in advance.
Lynx