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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating database! Please help!

Status
Not open for further replies.

chassid

MIS
Aug 27, 2000
58
US
All,

This program was working, but I messed around with it and something happened so it does not work anymore. The problem is with the delete and insert fields, but I am posting everything to see if there may be a problem with the rest.

Any help will be greatly appreciated,
Daniel

<%
If Request.Form(&quot;Submit&quot;)=&quot;Submit&quot; Then

'Get Form details
first=Request.Form(&quot;first&quot;)
last=Request.Form(&quot;last&quot;)
email=Request.Form(&quot;email&quot;)
pnew=Request.Form(&quot;new&quot;)
prenew=Request.Form(&quot;renew&quot;)

'Check that user supplied fields are completed
If first=&quot;&quot; OR last=&quot;&quot; OR email=&quot;&quot; OR pnew=&quot;&quot; or prenew=&quot;&quot; THEN
response.redirect(&quot;passw3.asp&quot;)

ELSE
'update e-mail address
Dim con, sql_insert, data_source
If pnew <> prenew then
response.redirect(&quot;passw2.asp&quot;)
else
sql_delete = &quot;delete from password where access_username = '&quot;& last &&quot;'&quot;
sql_insert = &quot;insert into password (access_firstname, access_username, email, access_password) values ('&quot;& first &&quot;', '&quot;& last &&quot;', '&quot;& email &&quot;', '&quot;& prenew &&quot;')&quot;
Set con = Server.CreateObject(&quot;ADODB.Connection&quot;)
con.Open &quot;password&quot;
con.Execute sql_delete
con.Execute sql_insert
con.Close
Set con = Nothing
Response.redirect(&quot;done2.asp&quot;)

end if
END IF


End If
%>

Do you know the Chabad Lubavitch Sheliach in your area?
He is waiting for you!
 
What happens when you run the code?? Do you get any error messages??

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top