Microsoft KB Archive/278099

= ACC2000: &quot;????????&quot; Is Displayed as the Value of a SQL Server GUID Field =

Article ID: 278099

Article Last Modified on 12/12/2002

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q278099



Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
When you use Visual Basic for Applications (VBA) code to retrieve and display the value of a Jet Replication ID or a SQL Server Unique Identifier(GUID) field, you get a value of &quot;????????&quot;.



CAUSE
A GUID is a 16-byte array that Microsoft Access does not know how to interpret unless the data is converted.



RESOLUTION
To enable Access to properly interpret and display a GUID field, convert the GUID field to a string by using the StringFromGUID function. For example, when you run the following code against an open form with a GUID field in its record source, you will see a string of hexadecimal numbers enclosed in braces preceded by the word &quot;guid&quot; and enclosed by another set of braces.

Note that Debug.Print StringFromGUID(Forms![FormName]![GUIDFieldName]) is displayed something like this:

{guid {3B9B63A3-863D-11CF-8CAE-00AA00C0016B}}



Steps to Reproduce the Behavior
 Open the sample Access project NorthwindCS.adp. Create a table named tblGuid and name one of its fields fldGUID. Make fldGUID a UniqueIdentifier data type and set the Is RowGUID property to true. Add some records to the tblGUID table. Create a form that is bound to the entire tblGUID table.  Add a command button to the form, and then set the OnClick property of the command button to the following event procedure: Msgbox Me!fldGUID View the form in Form view, and then click the command button. Note that you receive a message box that displays &quot;????????&quot;. </li></ol>

<div class="references_section">