Hi Carl, what I mean by "reading" the previous ID is similar to David's idea
#2: use a recordset (which is an Active X data Object (ADO)thing - not sure
what you'd do with perl) to append your new record, then get the Id of that
new record (using a method of the recordset object), making sure you account
for multiusers, i.e. either using a transaction or a timestamp or something
to make sure you're getting the ID from the record you just added.
"Carl" <mail2carl@_remove_yahoo.com> wrote in message
news:j10xe.26305$BD2.14816@newsfe1-gui.ntli.net...[color=blue]
> Hi John.....I do but I prefer Perl as it will be a internet based
> database running on Unix and Win32.
>
> It looks like the only solution is to create my own ID generation
> routines.
> I cannot rely on a INSERT then a SELECT to get the last ID entered.
> There may be a situation where after the INSERT to the AccountsTable,
> another client may create a new Account which would trigger another
> INSERT.
>
> How do you "read" the ID of the newly inserted ID ??? What do you mean by
> this ??
> What happens if another INSERT is triggered before I've "read" the
> previous ID ??
>
> I was under the impression that INSERT querys don't return anything.
>
> thanx for reply.
>
>
> "John Welch" <jwelch@fred.com> wrote in message
> news:da1t6401riv@enews4.newsguy.com...[color=green]
>> Do you have any experience with visual basic? If so, you could do at
>> least a couple different things:
>> 1) you could create your own routine to generate the ID value so that you
>> don't have to use an autonumber field, and then you could insert into
>> each table with your ID value.
>> 2) you could use
vb to insert the fields into the Accounts table, then
>> read the ID of the newly inserted ID value, then insert that ID into the
>> Members table.
>>
>> "Carl" <mail2carl@_remove_yahoo.com> wrote in message
>> news:MtZwe.13254$11.3650@newsfe2-win.ntli.net...[color=darkred]
>>> Hi,
>>>
>>> I hope someone can share some of their professional advice and help me
>>> out
>>> with my embarissing problem concerning an Access INSERT query. I have
>>> never
>>> attempted to create a table with one-to-one relationship but on this
>>> occasion
>>> I must keep username/password details within a seperate table.
>>>
>>> Here's the basic specs and database schema:
>>> -------------------------------------------
>>>
>>> Database: Basic MS Access 2000 MDB
>>> Table Relationships: Both tables are joined one-to-one on their ID
>>> fields.
>>>
>>> TableMembers
>>> ID: Long Integer; Required; Indexed(Unique); PrimaryKey;
>>> Firstname: Text 50; Required;
>>> Lastname: Text 50; Required;
>>> Telephone: Text 50; Required;
>>>
>>> TableAccounts
>>> ID: AutoNumber; Required; Indexed(Unique); PrimaryKey;
>>> Username: Text 50; Required;
>>> Password: Text 50; Required;
>>>
>>>
>>> The problem:
>>> ------------
>>> In an ideal world I would like to use a single SQL INSERT on both tables
>>> to insert
>>> the required data. But I know this isn't possible as INSERT works on
>>> single tables only, right ?
>>>
>>> I cannot use an SQL INSERT on TableMembers as the ID field is created by
>>> the AutoNumber
>>> in TableAccounts.ID.
>>>
>>> I could INSERT into TableAccounts first, which would auto-create the ID,
>>> but how do I use the
>>> ID in the second SQL INSERT on TableMembers ???
>>>
>>> When I open the TableAccounts Table in Access, I can manually input all
>>> data for both Tables
>>> without any problems. TableMembers Fields are displayed as a dropdown
>>> record from TableAccounts
>>> and the ID field is automatically taken care of.
>>>
>>> Can Anyone here can offer some advice or solutions, all replies greatly
>>> appreciated.
>>>
>>> Carl.
>>>
>>>
>>>
>>>[/color]
>>
>>[/color]
>
>[/color]