Update records with multiple keys (ASP VBScript)
In my table I have created a primary key on the combination of two fields. I use a command to update this table. The problem is that one of the fields i'm going to update is a part of the primary key. I get no error message, but the current record is not updated. When i try to update the record without changing the field which is a part of the primary key everything works fine.
The table-design and Dreamweaver command is shown below:
Tablename = tbl_Place_of_work
Employeeid - Int - 4
Phonenumber - varchar - 20
Division - char - 5
Sphere - varchar - 70
The combination of Employeeid And Division are the primary key
SQL
UPDATE dbo.tbl_Place_of_work
SET Phonenumber = 'varPhonenumber', Division = 'varDivision', Sphere = 'varSphere'
WHERE Employeeid = varEmployeeid AND Division = 'varDivision'
Variables
varPhonenumber = Request("Phonenumber")
varDivision = Request("Division")
varSphere = Request("Sphere")
varEmployeeid = Request("Employeeid")
My Regards,
Rune
|