ACC2000: Unexpected Behavior with Case-Sensitive Objects (223202)
The information in this article applies to:
This article was previously published under Q223202 Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies only to a Microsoft Access project (.adp).
SYMPTOMS
In a Microsoft Access project, if you are connected to either a Microsoft SQL Server or to a Microsoft Data Engine (MSDE) that has a Sort Order set to "Dictionary order, case-insensitive," but has Unicode Collation case sensitivity turned on, you can see unexpected behavior. This behavior can occur with this type of server if you have objects that have the same name but that are spelled with all or some letters in a different case. In this scenario, you can see the following two unexpected behaviors:
Wrong Object Is Deleted
If in the user interface of the Access project, you try to delete the second or greater object of the same name, you find that actually the first object with that name is deleted. For example, suppose that you have the following tables listed:
categories
Categories
CATEGORIES
In an Access project file connected to this database, if you try to delete the table named "CATEGORIES," you find that you have actually deleted the table named "categories."
Table Appears to Contain No Data
If in the user interface, you try to open the second or greater table of the same name, you actually see the columns of the first table and they are empty. For example, suppose that you have the following tables listed:
categories
Categories
CATEGORIES
In an Access project file connected to this database, if you try to open the table named "CATEGORIES," you see that columns from the table named "categories" are shown instead and those columns are empty.
CAUSE
The Access project uses the sort order to determine which object to delete or open. The default Sort Order of both Microsoft SQL Server and Microsoft Data Engine is "Dictionary order, case-insensitive," meaning they ignore case when acting upon objects. Also, the default setting for Unicode Collation is case-insensitive. However, if during the setup of Microsoft SQL Server or MSDE, the Unicode Collation case sensitivity is turned on, but the Sort Order is left at the default of "Dictionary order, case-insensitive," it allows objects with the same spelling but with different case to exist on the server.
Using a server set up in this way, if you delete or open an object in the user interface of the Access project, Access finds the first occurrence of the object name that matches the spelling but does not try to match the case because it is using a dictionary sort order that is case-insensitive. Therefore, the wrong object could be chosen.
NOTE: This behavior does not occur if the server was set up with case-sensitive sort order as well as case sensitive Unicode collation.
RESOLUTION
The following steps show you how to work around these two behaviors. The steps use tables named CATEGORIES and Categories. You should replace these table names with the names of your tables.
Deleting Objects That Have Same Name/Different Case
Delete an object by using the DROP statement in a stored procedure. To do so, follow these steps:
- In the Database window, click Stored Procedures under Objects, and then click New.
- In Design view, type the following into the new stored procedure:
Create Procedure DelTable
AS
DROP TABLE CATEGORIES
Return
- Press F5 to refresh the Database window.
Browsing Tables That Have Same Name/Different Case
View the table by using a stored procedure. To do so, follow these steps:
- In the Database window, click Stored Procedures under Objects, and then click New.
- In Design view, type the following into the new stored procedure:
Create Procedure ShowTable
AS
SELECT * FROM Categories
Return
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 6/24/2004 |
---|
Keywords: | kbbug KbClientServer kbpending KB223202 |
---|
|