FIX: Error message C1046 when you use double-byte character set values (321573)



The information in this article applies to:

  • Microsoft Visio for Enterprise Architects (2002), when used with:
    • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition

This article was previously published under Q321573

SYMPTOMS

When you use double-byte character set (DBCS) values for an object in the Object Role Modeling (ORM) Source Model, you may receive the following error message, even though you did not enter more characters than the Length that is specified for the Data Type for the object.
"Error C1046: 'Name of Object' : Object Type has textual value of 'Value Entered' specified in its value range constraint that is larger than what the datatype allows."

RESOLUTION

To resolve this problem, install the latest service release for Visio for Enterprise Architects 2002. For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

320765 Visio2002: How to Obtain the Latest Visio for Enterprise Architects 2002 Service Release

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Visio for Enterprise Architects 2002 Service Release 1 (SR-1).

MORE INFORMATION

Steps to Reproduce the Behavior

To reproduce the behavior, you must have a Far East language Input Method Editor (IME) installed for your operating system. The steps presented here use a Japanese IME, but you can use any language that requires DBCS.

To reproduce the problem, follow these steps:
  1. Start Visio.
  2. On the File menu, point to New, point to Database, and then click ORM Source Model.
  3. To create a new fact, do the following:
    1. On the Database menu, point to View, and then click Fact Editor.
    2. In the first Object Name text box, type Parent.
    3. In the Relationship text box, type Has.
    4. In the second Object Name text box, type Child.

      Do not type anything in the Inverse Relationship box.
    5. Click OK to close the Fact Editor.
  4. On the Database menu, point to View, and then click Business Rules.
  5. Drag the fact that you created in step 3 to the ORM Diagram drawing grid.
  6. Click the predicate on the drawing page. On the Database Properties tab, click the Constraints category, and then click Add Internal.
  7. In the Add Constraint dialog box, click Uniqueness for the Constraint type, click to select the Primary check box, and then click in the left role box of the predicate. The left box becomes yellow and contains the number 1. Click OK.
  8. Click the Parent object on the drawing page, and then click the Database Properties tab.
  9. In the Ref Mode category, type ID for the Reference, and then type Identification for the Type.
  10. On the Database menu, click Model Error Check. You do not receive any errors.
  11. In the Data Type category, type the following values:

    Category: Text
    Type: Fixed Length
    Length: 20
    Size: Double Byte Character Set

  12. Click Show portable data type.
  13. On the Database Properties tab, click the Value category, in the Value text box, type at least 11 and no more than 20 Japanese characters as the value, and then click Add.
  14. On the Database menu, click Model Error Check.

Modification Type:MinorLast Reviewed:1/19/2006
Keywords:kbvs2005doesnotapply kbvs2005swept kbtshoot kbvs2002sp1sweep kbbug kbfix KB321573 kbAudDeveloper