Microsoft KB Archive/824168

= Microsoft Access closes when you try to export a table to an Access database =

Article ID: 824168

Article Last Modified on 6/9/2004

-

APPLIES TO


 * Microsoft Office Access 2003
 * Microsoft Access 2002 Standard Edition

-



Novice: Requires knowledge of the user interface on single-user computers.

This article applies only to a Microsoft Access project (.adp).



SYMPTOMS
In a Microsoft Access project, when you try to export a table to an Access database (*.mdb) and the table contains fields that have long field names, Microsoft Access closes unexpectedly. You receive the following error message:

Microsoft Office Access has encountered a problem and needs to close.

We are sorry for the inconvenience.



WORKAROUND
To work around this problem, use field names that are shorter.



MORE INFORMATION
The Access database depends on the Microsoft Jet database engine for storage. The Microsoft Jet database engine stores all the objects that are specific to Access, including forms, reports, macros, modules, and commandbars in the system tables for Access in the Microsoft Jet engine database. However, the Microsoft Access project uses Microsoft SQL Server for database storage. Therefore, Access projects are independent of the Microsoft Jet database engine.

Because the Microsoft Jet database engine does not support tables that have long field names (specifically, field names that are greater than 63 characters), exporting tables that have long field names to an Access database is not successful. When you try to import a table that has long field names into an Access database, the import process may fail, and you may receive the following error message in Access 2003:

ODBC--call failed.

[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name

'.

(#207)

If you use Access 2002, you may receive the following error message:

ODBC--call failed.

Steps to Reproduce the Problem
 Start Access. Open the Northwind sample Access project that is connected to a valid SQL Server database. In the database window, click Queries under Objects. In the right pane, double-click Create stored procedure in designer. In the Add Table dialog box, click Close. On the View menu, click SQL View.</li>  Paste the following stored procedure, and then save the stored procedure as StoredProcedure1: CREATE PROCEDURE StoredProcedure1 AS if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[table_longcolumn]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[table_longcolumn]

CREATE TABLE [dbo].[table_longcolumn] (   [aaaaaaaaaabbbbbbbbbbaaaaaaaaaabbbbbbbbbbaaaaaaaaaabbbbbbbbbbaaaa] [char] (50) PRIMARY KEY NOT NULL,    [col1] [char] (50),    [col2] [int] NULL ) ON [PRIMARY]

RETURN </li> In the database window, double-click StoredProcedure1 to run the stored procedure.

Note When you run the StoredProcedure1 stored procedure, a new table is created in the Northwind project. This table is named table_longcolumn.</li> Right-click the table_longcolumn table, and then click Export.</li> In the Export Table 'table_longcolumn' To dialog box, click the Access database, and then click Export.</li> In the Export dialog box, click OK.

Microsoft Access stops responding and then closes unexpectedly.</li></ol>

Keywords: kberrmsg kbexport kbdatabase kbprogramming kbprb kbdesign KB824168

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.