Re: cant get next number



timasmith@xxxxxxxxxxx writes:

I guess more the fool me for attempting with MS Access but if I execute

select max(nbr) from mytable

nextnbr = maxnbr + 1

insert into mytable (nextnbr...)

multiple times - it appears the first insert is not picked up by the
next select max() - even using the same connection.

Is this due to not having committed i.e. Access query using the same
connection does not show modified data - or is it simply access cannot
register an insert fast enough for the next select?

Are you running in auto commit mode?

Connection.setAutoCommit(true);

--
dt

.



Relevant Pages

  • Re: Pass MailMerge.CreateDataSource to document from Access
    ... Running a macro in my Word 2003 environment showed the script I will use. ... >> with mailmerge back to my Access query as the data source. ... Test the available connection methods for the Office version involved. ...
    (microsoft.public.office.developer.automation)
  • ODBC Connection error when linking Excel to Access to SQL database
    ... I'm trying to link Excel to an Access query where the Access query is linked ... to an external database through a SQL ODBC connection. ...
    (microsoft.public.sqlserver.odbc)
  • DSN Behaving Badly
    ... the two connections required for an Access query. ... (The other connection uses the PostGRE SQL connection and works as ... When I created the DSN, I specified that it should use SQL Server ... However, when I attempt to run the query, I get a "Connection Failed" ...
    (comp.databases.ms-access)
  • Using Access Queries???
    ... How do i setup a connection that looks at a access query instead of a table? ... is a query assigned a command.type = "StoredProcedure" when setting up the ...
    (microsoft.public.dotnet.framework.adonet)