BUG: NSQLPREP Substitutes DBCS Object Name with a Null String (166202)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q166202
BUG #: 16754
BUG #: 50033 (SHILOH)

SYMPTOMS

The NSQLPREP substitutes a double-byte character set (DBCS) string with a null string if a DBCS string was used for the object name.

WORKAROUND

To work around this problem, use the single-byte character set (SBCS) for the object name.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

The following procedure demonstrates this problem:
  1. Create a table with a DBCS name.
          CREATE TABLE tableName (col INT)
          GO
          /* where tableName must be in DBCS */ 
      
    						
  2. Create a <File name>.sqc file that contains the following:
          EXEC SQL INCLUDE SQLCA;
          main()
          {
             EXEC SQL INSERT tableName VALUES (1);
             /* where tableName must be in DBCS */ 
          }
      
    						
  3. Run the pre-compiler to generate the <File name>.C file. You will observe the following problem:
          main()
          {
             .....
    
             /*
             EXEC SQL INSERT tableName VALUES (1)
             */ 
             .....
             sqlxcall(24, 1, 0, 0, 21, (char far *) "  INSERT  VALUES (1)");
             .....
          }
      
    						

Modification Type:MinorLast Reviewed:2/22/2005
Keywords:kbBug kbpending kbProgramming kbusage KB166202