Hi,
I have an Access 2003 project front end on SQL Server 2008 back end.
I have a form containing patient data which has a subform containing data about when an examination was performed for the cycle of treatment for the current patient.
The subform (the problem form) has a data source as follows;
SELECT a.phys_exam_clinically_indicated_pk, a.exam_date, a.patient_cycle_fk, b.patient_fk
FROM phys_exam_clinically_indicated a, patient_cycle b
WHERE a.patient_cycle_fk = b.patient_cycle_pk
I have the unique table property set to the phys_exam_clinically_indicated table as this is where data should be updated/inserted.
The write conflict occurs when trying to insert a new record (despite the data being successfully written to the table). I've seen it suggested that adding a timestamp field can prevent this. So I added one to the phys_exam_clinically_indicated table and found the following;
When the data source is left as above;
1. If phys_exam_clinically_indicated has no records, the fields do not display on the form (ie. it is blank) so no records can be entered
2. If a record exists, the recordset is not updateable.
I changed the data source to include the new timestamp field as follows;
SELECT a.prevent_write_conflict, a.phys_exam_clinically_indicated_pk, a.exam_date, a.patient_cycle_fk, b.patient_fk
FROM phys_exam_clinically_indicated a, patient_cycle b
where a.patient_cycle_fk = b.patient_cycle_pk
Now I find I can update existing records without causing a conflict, but cannot insert new records and get the error message:
Run-time error 273: Cannot insert an explicit value into a timestamp column. Use Insert with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column.
As far as I'm aware, you cannot insert into timestamp columns. So, how do I exclude this column from the insert list, without encountering the problem with the recordset not being updateable????
Any help gratefully received as this is making my already bald head much balder....
I have an Access 2003 project front end on SQL Server 2008 back end.
I have a form containing patient data which has a subform containing data about when an examination was performed for the cycle of treatment for the current patient.
The subform (the problem form) has a data source as follows;
SELECT a.phys_exam_clinically_indicated_pk, a.exam_date, a.patient_cycle_fk, b.patient_fk
FROM phys_exam_clinically_indicated a, patient_cycle b
WHERE a.patient_cycle_fk = b.patient_cycle_pk
I have the unique table property set to the phys_exam_clinically_indicated table as this is where data should be updated/inserted.
The write conflict occurs when trying to insert a new record (despite the data being successfully written to the table). I've seen it suggested that adding a timestamp field can prevent this. So I added one to the phys_exam_clinically_indicated table and found the following;
When the data source is left as above;
1. If phys_exam_clinically_indicated has no records, the fields do not display on the form (ie. it is blank) so no records can be entered
2. If a record exists, the recordset is not updateable.
I changed the data source to include the new timestamp field as follows;
SELECT a.prevent_write_conflict, a.phys_exam_clinically_indicated_pk, a.exam_date, a.patient_cycle_fk, b.patient_fk
FROM phys_exam_clinically_indicated a, patient_cycle b
where a.patient_cycle_fk = b.patient_cycle_pk
Now I find I can update existing records without causing a conflict, but cannot insert new records and get the error message:
Run-time error 273: Cannot insert an explicit value into a timestamp column. Use Insert with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column.
As far as I'm aware, you cannot insert into timestamp columns. So, how do I exclude this column from the insert list, without encountering the problem with the recordset not being updateable????
Any help gratefully received as this is making my already bald head much balder....