Microsoft KB Archive/105648

From BetaArchive Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

PRB: "Type Mismatch" Error Using CLng() with Hex Value

Article ID: Q105648
Creation Date: 22-OCT-1993
Revision Date: 01-DEC-1996 The information in this article applies to:

  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0, 97

SYMPTOMS


Advanced: Requires expert coding, interoperability, and multiuser skills.

When you use the CLng() data type conversion function on a hexadecimal string with quotation marks and ampersands at each end, for example, CLng("&Hxxxx&"), you may receive the following error message:

   Type Mismatch

For example,

   Val("&H7777")
   Val("&H7777&")
   CLng(&H7777)
   CLng(&H7777&)
   CLng("&H7777")

all correctly return the value 30583, but

   CLng("&H7777&")

returns the error message. STATUS


This behavior is by design.



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

©1997 Microsoft Corporation. All rights reserved. Legal Notices.


KBCategory: kbprg kberrmsg
KBSubcategory: PgmOthr
Additional reference words: 1.00 1.10 2.00 7.00 97 8.00 decimal