[thelist] Pausing ASP script when no acces to SQL server

Chris Marsh thelist at cjmarsh.com
Wed Aug 16 08:48:25 CDT 2006


Chris

[..]

> I know this is a botch so is there any other option available 
> I've missed? Or is this just about acceptable given that only 
> 1 user will have access to the script when it's on the live 
> server and at most it will be run 5 times a day?

If you're using Access 2000 or later, you should be able to use the
following query to retrieve the ID after you have run your initial INSERT
query:

SELECT @@IDENTITY

This will return the latest ID that's been created from an INSERT statement.
You will not need to pause your VBScript processing. The only risk is that
another INSERT query is run between your first INSERT query and your SELECT
@@IDENTITY query, thus providing an incorrect ID. However, given the low
usage of your system this is highly unlikely, and IMHO this is a *much* more
appropriate solution to your problem than pausing your script.

If you're not running Access 2000+, then a solution appears to be presented
at the following URI. I haven't checked it out in any detail, but it make be
of some use to you.

<http://objectsharp.com/blogs/bruce/articles/210.aspx>

HTH

-- 
Regards

Chris Marsh 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.10.10/419 - Release Date: 15/08/2006
 





More information about the thelist mailing list