ACC95: Error Using Identity Column with Data Outline ControlLast reviewed: June 6, 1997Article ID: Q167854 |
The information in this article applies to:
SYMPTOMSModerate: Requires basic macro, coding, and interoperability skills. When you use the Data Outline Control 1.1 to view data from a Microsoft SQL Server database, you receive the following error:
One of the specified RecordSources is invalid. CAUSEThe RecordSource property for one or more levels of the Data Outline Control contains an Identity column from the SQL Server table. An Identity column is similar to an AutoNumber field in Microsoft Access.
RESOLUTIONThere are two methods to work around this problem. You can change the RecordSource property so it does not include the Identity column, or you can base the RecordSource on a SQL pass-through query.
Method 1: Change the RecordSourceChange the RecordSource property in the Data Outline Control to eliminate the Identity column; you must change the RecordSource property for any level in the Data Outline control that contains an Identity column. For example, if you only need to see the job_desc, min_lvl, and max_lvl fields from the Jobs table in the Pubs sample database, set the RecordSource property to:
SELECT job_desc, min_lvl, max_lvl FROM dbo_jobs Method 2: Use a SQL Pass-Through QueryChange the RecordSource property so it uses a SQL pass-through query. This allows you to use the Identity column in your Data Outline Control. Be sure to include all the fields you need for your Data Outline Control level in the SQL pass-through query. For more information about creating and using SQL pass-through queries, search the Help Index for "pass-through queries."
STATUSMicrosoft has confirmed this to be a problem in Microsoft Access 7.0. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONNOTE: The error also occurs with the Data Outline Control 1.2 for Microsoft Access 97. That version of the control is provided by Microsoft as-is, and is not supported by Microsoft Technical Support. However, the resolution in this article also works with the Data Outline Control 1.2. For more information about obtaining the Data Outline Control 1.2, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q162359 TITLE : ACC97: Access 97 Data Outline ActiveX Control Available on MSL Steps to Reproduce ProblemNOTE: These steps assume you have access to the Pubs database included with Microsoft SQL Server.
|
Additional query words:ADT ODE OLE ActiveX
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |