C
Christian Vonäsch
Hi NG
I add a new record in a form.
The form's recordsource is a view "PrjSel":
CREATE VIEW PrjSel
WITH VIEW_METADATA
AS
SELECT *
FROM PrjTbl
WHERE (ForPrjManagersOnly=0) OR
(IS_MEMBER('PrjManagers') = 1)
The view shows all projects, if the current user is a member of the role
'PrjManagers'
If the user is not a member of this role, he only gets the projects NOT
ForPrjManagersOnly.
To avoid access to all projects to everybody I deny access to the table
PrjTbl directly:
DENY SELECT ON PrjTbl TO ALL
The WITH VIEW_METADATA in PrjSel is necessary to allow data addition in the
view through a form.
(Otherwise adp tries to add a record directly to the table, but if
select-access is denied it fails.)
The form's properties are:
RecordSource = "PrjSel"
Serverfilter = ""
UniqueTable = "PrjSel" (this works because of the WITH VIEW_METADATA!)
Resynch = "select * from PrjSel where PrjID=?"
Now the problem is, that the control which displays the PK: PrjID gets a 0
instead of the new identity-value.
Therefore my subform linked via PrjID (masterfields-childfields) doesn't
work and displays no record!
Only after requerying and jumping to the newly added record, the PrjID is
displayed correctly and the subform works.
Thank you for your help. (adp2000; SQL2000)
Christian Vonäsch
I add a new record in a form.
The form's recordsource is a view "PrjSel":
CREATE VIEW PrjSel
WITH VIEW_METADATA
AS
SELECT *
FROM PrjTbl
WHERE (ForPrjManagersOnly=0) OR
(IS_MEMBER('PrjManagers') = 1)
The view shows all projects, if the current user is a member of the role
'PrjManagers'
If the user is not a member of this role, he only gets the projects NOT
ForPrjManagersOnly.
To avoid access to all projects to everybody I deny access to the table
PrjTbl directly:
DENY SELECT ON PrjTbl TO ALL
The WITH VIEW_METADATA in PrjSel is necessary to allow data addition in the
view through a form.
(Otherwise adp tries to add a record directly to the table, but if
select-access is denied it fails.)
The form's properties are:
RecordSource = "PrjSel"
Serverfilter = ""
UniqueTable = "PrjSel" (this works because of the WITH VIEW_METADATA!)
Resynch = "select * from PrjSel where PrjID=?"
Now the problem is, that the control which displays the PK: PrjID gets a 0
instead of the new identity-value.
Therefore my subform linked via PrjID (masterfields-childfields) doesn't
work and displays no record!
Only after requerying and jumping to the newly added record, the PrjID is
displayed correctly and the subform works.
Thank you for your help. (adp2000; SQL2000)
Christian Vonäsch