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

Update a record and it's duplicates at same time

Status
Not open for further replies.

Joelo

MIS
Joined
Sep 27, 2003
Messages
61
Please anybody.....I need this Urgently.

Is it possible to Update a record and it's duplicates at same time?....How can I do it

Thanks in advance
 
what do you mean by duplicates?

do you jsut mean update in sql as

UPDATE table SET column = 'something' WHERE column = 'something'

saying update all columns that may equal the value of something.

_____________________________________________________________________
onpnt2.gif

Hakuna matata!!
 
Thanks for your quick response

Can I do it with record set

This is what I have:

strsql = "select all * from [usersdatabase]" _
& " where userid = '" & Session("userid") & "' AND lastname = '" & session("lastname") & "' AND firstname = '" & session("firstname") & "'"
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strsql, conn, 1, 2
if (rs.BOF and rs.EOF) then
Response.Write(&quot;<font size='3' color='red'><b>Userid '&quot; & userid & &quot;' not found, try again.....</b></font><p>&quot;)
elseif Request.form(&quot;password&quot;) <> rs(&quot;PASSWORD&quot;) then
Response.Write(&quot;<font size='3' color='red'><b>Incorrect Current password, Please try again....</b></font><p>&quot;)
else
'Update record with new password.
rs(&quot;USERID&quot;) = Session(&quot;userid&quot;)
rs(&quot;PASSWORD&quot;) = Request.Form(&quot;newpass1&quot;)
rs.Update
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
Response.Write(&quot;<font size='3' color='red'><b>Your password has been successfully changed.....Thank You</b></font><p>&quot;)
end if
end if
end if
 
what I am trying to do is:...I have a users table and list of user...one user is assigned to different facility
ie

Lname Fname UID Pword Facility
GOO MOO M MEE LAG
GOO MOO M MEE MAG
GOO MOO M MEE WAG

I want to be able change Pword all at same time

I don't know if I am making any sense
 
lname=&quot;GOO&quot;
password=&quot;123&quot;

sql=&quot;Update tablename set Pword='&quot; & password & &quot;' Where Lname='&quot; & lname & &quot;'&quot;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top