ACC2000: CommandTimeOut Expired Error When You Try to Make a Design Change to an Access Project (243464)
The information in this article applies to:
This article was previously published under Q243464 Advanced: Requires expert coding, interoperability, and multiuser
skills.
This article applies only to a Microsoft Access project (.adp).
SYMPTOMS In an Access project, when you try to make a design change
to a very large table (in most cases in excess of 1 million records), you may
receive the following error message: Errors were
encountered during the save process. Some of the database objects on your
diagram were not saved.
'<table name> Table Unable to
modify table. ADO Error. Timeout Expired. CAUSE You encountered a built-in time-out before the command
could be completed. If the command from the Access project takes over thirty
seconds (the default value) for the server to complete, a time-out error
occurs. This can happen, for example, when you perform DDL (Data Definition
Language) operations on tables that contain large amounts of data. This can
happen when you perform such design changes as adding a primary key or index to
a table or when you change a field's data type or attributes. You cannot modify
this time-out property within the Access user interface. RESOLUTION Create a Visual Basic for Applications procedure in the
Access project that runs the ADO Command object. The ADO Command object can programmatically make changes to the design of a large
table without error if the .CommandTimeOut property is set either to a large enough positive value or to
zero (0), which means that is should never time out. In the
following example, the field BigID is added and is also set as the primary key
in the table tblLarge:
Sub addPrimaryKey()
Dim ADOCmd As ADODB.Command
Set ADOCmd = New ADODB.Command
With ADOCmd
.CommandText = "ALTER TABLE tblLarge ADD " _
& "BigID INT IDENTITY " _
& "CONSTRAINT BigID_pk PRIMARY KEY;"
.ActiveConnection = CurrentProject.Connection
.CommandTimeout = 0
.Execute
End With
Set ADOCmd = Nothing
End Sub
REFERENCESFor
additional information on a similar issue with Office Web Components, click the
article number below to view the article in the Microsoft Knowledge Base: 276270 DataSourceControl ConnectionTimeOut Property is Ignored
Modification Type: | Minor | Last Reviewed: | 1/26/2005 |
---|
Keywords: | KbClientServer kberrmsg kbprb KB243464 |
---|
|