Hi SteveSole,
I dont see you defining "updateset" anywhere in your code, like you have done for InsertSet
I think you are confusing with the code there.
In the code below I assume that the left part is a recordset object with COLUMN reference
set town
and the right part is the value you have retrieved from the FORM
"utown"
Code:
set town = "utown"
set postcode = upostcode
set("alerts") = alerts
In the following code, I assume that you Add a new record if profile details does not pre-exist. If it pre-exists then you FIND the exisiting record for which you are using InsertSet and UpdateSet respectively. But you run the Update and Close methods using UPDATESET and setting NOTHING to INSERTSET. How will that work for you?
Code:
if p_existing = "" then
insertset.AddNew
else
updateset.Find "username =" &p_existing
end if
set town = "utown"
set postcode = upostcode
set("alerts") = alerts
updateset.Update
updateset.Close
set insertset = Nothing
I think you got to change the code this way.
Code:
if p_existing = "" then
insertset.AddNew
else
insertset.Find "username =" &p_existing
end if
insertset("town") = town
insertset("postcode") = postcode
insertset("alerts") = alerts
insertset.Update
insertset.Close
set insertset = Nothing
SET keyword should be used only when you initialize an OBJECT type variable,like this.
set insertset = Server.CreateObject("ADODB.RecordSet")
Cannot be used for assigning a string/int/anyother value to a variable.
Code:
set town = "utown"
set postcode = upostcode
set("alerts") = alerts
This makes sense?
Hope that helps.
Cheers!
_________________________
-Vijay G

Strive for Perfection
