
Signature
KARL DEWEY
Build a little - Test a little
On Jul 30, 4:18 pm, KARL DEWEY <KARLDE...@discussions.microsoft.com>
wrote:
> > Is there any what I can find out when a record was created?
>
[quoted text clipped - 3 lines]
> KARL DEWEY
> Build a little - Test a little
Did you test a little? There's more to it than that:
CREATE TABLE PrivateTest
(
ID INTEGER NOT NULL UNIQUE,
date_stamp DATETIME DEFAULT NOW() NOT NULL
)
;
INSERT INTO PrivateTest (ID, date_stamp)
VALUES (1, #1990-01-01 00:00:00#)
;
SELECT ID, date_stamp
FROM PrivateTest
;
Oops! That row didn't get the correct timestamp i.e. not today's date.
The 'timestamp' column should perhaps be hidden:
CREATE VIEW PublicTest (ID) AS
SELECT ID
FROM PrivateTest
;
INSERT INTO PublicTest (ID)
VALUES (2)
;
SELECT ID, date_stamp
FROM PrivateTest
;
Now REVOKE permissions from PUBLIC on the base table and grant them
instead to the VIEW.
Jamie.
--