Re: Data concept
- From: v-kevy@xxxxxxxxxxxxxxxxxxxx (Kevin Yu [MSFT])
- Date: Mon, 19 Jun 2006 06:42:33 GMT
Hi John,
This is a very typical problem. If the primary key of a table is an
auto-number column, we can use Refresh DataSet option in the DataAdapter
wizard to get the real number in database. If you select that option, an
additional SELECT statement will be generated after INSERT statement. It
will get the SCOPE_IDNETITY() from the database with the value just
generated.
When you generate a row in the DataSet and need to insert it into the
database table, the auto-number column value is actually not put into the
database. Instead, the database generates the ID. So the SELECT statement
will put the value back to DataSet and makes it refreshed.
However, since Access doesn't support batch SQL execution, this cannot be
done with an Access database. In this case, if you have multiple people
accessing the database simultaneously, I suggest you port the database to
SQL Express 2005, which is free and support batch execution.
HTH.
Kevin Yu
Microsoft Online Community Support
============================================================================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
============================================================================
==========================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
.
- References:
- Data concept
- From: John
- RE: Data concept
- From: Kevin Yu [MSFT]
- Re: Data concept
- From: John
- Data concept
- Prev by Date: How to return counter value from Access
- Next by Date: Re: Handling Concurrency in an Access DB using VB .Net 2003 and Jet Ol
- Previous by thread: Re: Data concept
- Next by thread: Storing Date value into Access DB
- Index(es):