If I can remember right, Select MAX... will only work on an Updated
recordset. You may want to try something like this;
SELECT Count(*) AS TotalOrders FROM Orders
-----Original Message-----
From: Joe Schell <[EMAIL PROTECTED]>
To: Roland Corbet <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
<[EMAIL PROTECTED]>; [EMAIL PROTECTED]
<[EMAIL PROTECTED]>
Date: Tuesday, April 03, 2001 11:33 AM
Subject: Re: Find Autonum just Entered
>Roland Corbet wrote:
>>
>> I'm Using DBI::ODBC with MS Access 200.
>>
>> Can anyone tell me what is the best way of getting hold of the Autonumber
>> that has just been entered into the database with the previously executed
>> SQL statement.
>>
>> Perhaps a "select Max from Tablename"? The site is only going to have
>> low-usage, so I would think this might be acceptable, as it's very
unlikely
>> that someone could have entered another entry between the insert and
select
>> max statements.
>>
>> I was just wondering if there was a 'watertight' method that I could
adopt
>> instead of "select max"?
>>
>
>I do know there is a way, but unfortunately I can't remember how. It is
>something like
>
> insert ...;
> select @@autonumber
>
>The above is only a guess. I am pretty sure it requires two statements
>(in the same call) and it uses a special variable/parameter.
>
>And, of course, it only works with MS Access.
>_______________________________________________
>Perl-Win32-Database mailing list
>[EMAIL PROTECTED]
>http://listserv.ActiveState.com/mailman/listinfo/perl-win32-database
>