ACC1x: Implementing Counter Values on Attached SQL Server TablesLast reviewed: May 20, 1997Article ID: Q100166 |
The information in this article applies to:
SUMMARYWhen you create a table in Microsoft Access and port it to SQL Server, some tasks are difficult to implement because SQL Server does not include a Counter data type. This article discusses how to maintain the counter functionality of an attached SQL Server table.
MORE INFORMATIONWith a multiuser system, you must take special precautions. Assume that the Counter column in SQL Server is called ID and that ID is the unique index for this table. In most cases, users try to simulate counters with a SQL Server OnInsert trigger that computes the maximum value and adds 1. However, Microsoft Access uses that index (bookmark) to point to the record and is not aware that the trigger is changing the index value. Thus, Microsoft Access loses track of that record until the next time the table is queried. Since SQL Server triggers do not work and SQL Server does not have a unique Counter data type as does Microsoft Access, you must use an Access Basic function to control the counter value, as in the procedure below:
|
Keywords : kbusage OdbcOthr
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |