Re: Data concept



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.)

.