Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error updating records in database!

Status
Not open for further replies.

lynxvoodoo

Technical User
Dec 28, 2002
14
GB
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=&quot;db.asp&quot; -->

<%
'Get the users name passed from the previous page
strUserName = Request.QueryString(&quot;name&quot;)
%>

<%
firstname = Request(&quot;firstname&quot;)
lastname = Request(&quot;lastname&quot;)
address1 = Request(&quot;address1&quot;)
address2 = Request(&quot;address2&quot;)
town = Request(&quot;town&quot;)
postcode = Request(&quot;postcode&quot;)
phone = Request(&quot;phone&quot;)
country = Request(&quot;country&quot;)
email = Request(&quot;email&quot;)


'The following sql statement is used to insert new customer data into the database.
sqlAdd = &quot;UPDATE customerdetails SET customerFirstName='&quot;&firstname&&quot;',&quot; &_
&quot; customerLastName='&quot;&lastname&&quot;', customerHomeAddress1='&quot;&address1&&quot;', customerHomeAddress2='&quot;&address2&&quot;', customerCity='&quot;&town&&quot;', customerPostCode='&quot;&postcode&&quot;', customerHomePhone=&quot;&phone&&quot;, customerCountry='&quot;&country&&quot;', customerEmailAddress='&quot;&email&&quot;' WHERE &quot; &_
&quot; customerUserName='&quot;&strUserName&&quot;'&quot;

call openConn()
dbc.execute sqlAdd, intAffected

If intAffected = 1 then
sql = &quot;SELECT max(customerID) from customerdetails&quot;
set rs = dbc.execute(sql)
CustomID = rs(0)
call closeConn()
Session(&quot;cid&quot;) = CustomID
Response.Redirect &quot;checkout2.asp&quot;
Else
call closeConn()

Response.Redirect &quot;displayerrormsg.asp?msg=&quot; & Server.URLEncode(&quot;Sorry! Could not process your data. Please try again later.&quot;)
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top