ok, say I have a database with two fields name and password where all the names must be unique in a table called names. So...
set rs = Server.CreateObject("ADODB.Recordset"

set conn = Server.CreateObject("ADODB.Connection"

...open your connection to your database
name = request.form("name"

password = request.form("password"
SQL = "SELECT * FROM names where name='" & name & "'"
rs.open SQL, conn
'If it didn't find a name, INSERT, otherwise, UPDATE
if rs.eof then
rs.close
SQL = "INSERT INTO names (name,password) VALUES ('" & name & "','" & password & "')"
conn.Execute(SQL)
else
rs.close
SQL = "UPDATE names SET name='" & name & "', password='" & password & "' WHERE name='" & name & "'"
conn.Execute(SQL)
end if
set rs = nothing
conn.close
set conn = nothing
There you go!
Harold Blackorby
hblackorby@scoreinteractive.com
St. Louis, MO