Skip to main content
Published: October 09 2006, 2:17:00 PMUpdated: November 28 2020, 2:53:15 PM

I am using the .NET SDK with vb6, and I am stuck on a problem deciphering the item.ListingType codes.
The codes are being returned in Numeric format as per the old Legacy Schema and not in string format as they should be under the SDK.
How can I get the string values?


Accessing the value for Item.ListingType in VB6 using the .NET SDK returns the numerical value of the enum.
This is the correct behavior, and there is no way in VB6 to get the string value from an instance variable of an enum.

Detailed Description

The reason you are seeing numeric values is simply that this is how enums work in VB6.
If you go into the VB6 Object Browser, you will see that ListingTypeCodeType is an enum, and you will see the numerical values assigned to each member.

For example, here are the values from the 479 Full Release version:
Const ListingTypeCodeType_AdType = 5
Const ListingTypeCodeType_Auction = 4
Const ListingTypeCodeType_Chinese = 1
Const ListingTypeCodeType_CustomCode = 12
Const ListingTypeCodeType_Dutch = 2
Const ListingTypeCodeType_Express = 11
Const ListingTypeCodeType_FixedPriceItem = 8
Const ListingTypeCodeType_Half = 9
Const ListingTypeCodeType_LeadGeneration = 10
Const ListingTypeCodeType_Live = 3
Const ListingTypeCodeType_PersonalOffer = 7
Const ListingTypeCodeType_StoresFixedPrice = 6
Const ListingTypeCodeType_Unknown = 0

Please refer to the Object Browser for the SDK version that you are referencing in your VB6 project for the values that apply to you.

Please note that these values do not necessarily correspond to the integer values for item types as defined in the Legacy API.
For example, 7 is the value for a Store item in the Legacy API, but the enum value is
Const ListingTypeCodeType_StoresFixedPrice = 6

In VB.NET it is possible to get the "string" values either from the enum type (How to: Determine the String Associated with an Enumeration Value) or for an instance variable using the ToString Method (Enum.ToString Method), but there is no equivalent in VB6.

Additional Resources

How well did this answer your question?
Answers others found helpful