Re: Binding Access Forms to a SQL Server Data source : View Or Sto
From: Malcolm Cook (mec_at_stowers-institute.org)
Date: 07/14/04
- Next message: Malcolm Cook: "Re: No error messages showing"
- Previous message: Malcolm Cook: "Re: Can't Open Table Design View after Moving Database"
- In reply to: J. Clay: "Re: Binding Access Forms to a SQL Server Data source : View Or Sto"
- Next in thread: Vadim Rapp: "Re: Binding Access Forms to a SQL Server Data source : View Or StoredP"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 14 Jul 2004 15:17:00 -0500
I've been lurking with interest...
> It has been about 2 1/2 years since I had this set up this way, so I can't
> remember exacty why I didn't use @@IDENTITY. I do know there were a
couple
> of issues that I was dealing with. One of them I believe was making sure
> there was no way a user could insert a record (Mouse wheel, page down,
etc.)
> other than using the button on the form.
Another thing to be aware of with @@IDENTITY is that if you have triggers
that perform automagic inserts into other tables that in turn have IDENTITY
columns, you MUST contrive to cache @@IDENTITY coming into your trigger
(i.e. set @myid = @@IDENTITY)and reset it before leaving, or else access
will not be able to correctly track the row inserted and you will get error
messages (like, the row does not satisfy the underlying criteria, or some
such).
Here is snippet to reset @@IDENTITY to @myid before the trigger completes:
EXECUTE (N'SELECT Identity (Int, ' + Cast(@myid As Varchar(10)) + ',1) AS id
INTO #Tmp'
Cheers,
-- Malcolm Cook - mec@stowers-institute.org Database Applications Manager - Bioinformatics Stowers Institute for Medical Research - Kansas City, MO USA
- Next message: Malcolm Cook: "Re: No error messages showing"
- Previous message: Malcolm Cook: "Re: Can't Open Table Design View after Moving Database"
- In reply to: J. Clay: "Re: Binding Access Forms to a SQL Server Data source : View Or Sto"
- Next in thread: Vadim Rapp: "Re: Binding Access Forms to a SQL Server Data source : View Or StoredP"
- Messages sorted by: [ date ] [ thread ]