Microsoft Knowledge Base Email Alertz

KBAlertz.com: (217188) - The OLE DB Provider Templates define the CCOLUMNSRow class assigned to implement OLE DB's COLUMNS rowset. In the Atldb.h header file where this class is defined, the Provider column map for the class contains column names that are different from the...

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
KBAlertz referrals get
** SIX MONTHS FREE **


Community Site



We Send hundreds of thousands of emails using ASP.NET Email


ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 217188 - Last Review: February 24, 2004 - Revision: 2.1

FIX: CCOLUMNSRow Column Names Are Incorrect

This article was previously published under Q217188

SYMPTOMS

The OLE DB Provider Templates define the CCOLUMNSRow class assigned to implement OLE DB's COLUMNS rowset. In the Atldb.h header file where this class is defined, the Provider column map for the class contains column names that are different from the OLE DB specification.

NOTE: It has been reported that Intersolv's Reflector looks for columns having the name according to the OLE DB specification, so customers using this product will encounter a problem with providers generated by the wizard.

RESOLUTION

This file is located in the C:\Program Files\Microsoft Visual Studio\VC98\ATL\Include directory.

The following shows the incorrect code:
BEGIN_PROVIDER_COLUMN_MAP(CCOLUMNSRow)
	PROVIDER_COLUMN_ENTRY("TableCatalog", 1, m_szTableCatalog)
	PROVIDER_COLUMN_ENTRY("TableSchema", 2, m_szTableSchema)
	PROVIDER_COLUMN_ENTRY("TableName", 3, m_szTableName)
	PROVIDER_COLUMN_ENTRY("ColumnName", 4, m_szColumnName)                  
	PROVIDER_COLUMN_ENTRY("Column",5, m_guidColumn)
	PROVIDER_COLUMN_ENTRY("ColumnPropID",6, m_ulColumnPropID)
	PROVIDER_COLUMN_ENTRY("OrdinalPosition",7, m_ulOrdinalPosition)
	PROVIDER_COLUMN_ENTRY("ColumnHasDefault",8, m_bColumnHasDefault)
	PROVIDER_COLUMN_ENTRY("ColumnDefault",9, m_szColumnDefault)
	PROVIDER_COLUMN_ENTRY("ColumnFlags",10, m_ulColumnFlags)
	PROVIDER_COLUMN_ENTRY("IsNullable",11, m_bIsNullable)
	PROVIDER_COLUMN_ENTRY("DataType",12, m_nDataType)
	PROVIDER_COLUMN_ENTRY("Type",13, m_guidType)
	PROVIDER_COLUMN_ENTRY("CharMaxLength",14, m_ulCharMaxLength)
	PROVIDER_COLUMN_ENTRY("CharOctetLength",15, m_ulCharOctetLength)
	PROVIDER_COLUMN_ENTRY("NumericPrecision",16, m_nNumericPrecision)
	PROVIDER_COLUMN_ENTRY("NumericScale",17, m_nNumericScale)
	PROVIDER_COLUMN_ENTRY("DateTimePrecision",18, m_ulDateTimePrecision)
	PROVIDER_COLUMN_ENTRY("CharSetCatalog", 19, m_szCharSetCatalog)
	PROVIDER_COLUMN_ENTRY("CharSetSchema", 20, m_szCharSetSchema)
	PROVIDER_COLUMN_ENTRY("CharSetName", 21, m_szCharSetName)
	PROVIDER_COLUMN_ENTRY("CollationCatalog", 22, m_szCollationCatalog)
	PROVIDER_COLUMN_ENTRY("CollationSchema", 23, m_szCollationSchema)
	PROVIDER_COLUMN_ENTRY("CollationName", 24, m_szCollationName)
	PROVIDER_COLUMN_ENTRY("DomainCatalog", 25, m_szDomainCatalog)
	PROVIDER_COLUMN_ENTRY("DomainSchema", 26, m_szDomainSchema)
	PROVIDER_COLUMN_ENTRY("DomainName", 27, m_szDomainName)
	PROVIDER_COLUMN_ENTRY("Description", 28, m_szDescription)
END_PROVIDER_COLUMN_MAP()<BR/>
				

The header file needs to be changed to reflect the correct column names. The following shows the corrected code:
BEGIN_PROVIDER_COLUMN_MAP(CCOLUMNSRow)
	PROVIDER_COLUMN_ENTRY("TABLE_CATALOG", 1, m_szTableCatalog)
	PROVIDER_COLUMN_ENTRY("TABLE_SCHEMA", 2, m_szTableSchema)
	PROVIDER_COLUMN_ENTRY("TABLE_NAME", 3, m_szTableName)
	PROVIDER_COLUMN_ENTRY("COLUMN_NAME", 4, m_szColumnName)
	PROVIDER_COLUMN_ENTRY("COLUMN_GUID",5, m_guidColumn)
	PROVIDER_COLUMN_ENTRY("COLUMN_PROPID",6, m_ulColumnPropID)
	PROVIDER_COLUMN_ENTRY("ORDINAL_POSITION",7, m_ulOrdinalPosition)
	PROVIDER_COLUMN_ENTRY("COLUMN_HASDEFAULT",8, m_bColumnHasDefault)
	PROVIDER_COLUMN_ENTRY("COLUMN_DEFAULT",9, m_szColumnDefault)
	PROVIDER_COLUMN_ENTRY("COLUMN_FLAGS",10, m_ulColumnFlags)
	PROVIDER_COLUMN_ENTRY("IS_NULLABLE",11, m_bIsNullable)
	PROVIDER_COLUMN_ENTRY("DATA_TYPE",12, m_nDataType)
	PROVIDER_COLUMN_ENTRY("TYPE_GUID",13, m_guidType)
	PROVIDER_COLUMN_ENTRY("CHARACTER_MAXIMUM_LENGTH",14, m_ulCharMaxLength)
	PROVIDER_COLUMN_ENTRY("CHARACTER_OCTET_LENGTH",15, m_ulCharOctetLength)
	PROVIDER_COLUMN_ENTRY("NUMERIC_PRECISION",16, m_nNumericPrecision)
	PROVIDER_COLUMN_ENTRY("NUMERIC_SCALE",17, m_nNumericScale)
	PROVIDER_COLUMN_ENTRY("DATETIME_PRECISION",18, m_ulDateTimePrecision)
	PROVIDER_COLUMN_ENTRY("CHARACTER_SET_CATALOG", 19, m_szCharSetCatalog)
	PROVIDER_COLUMN_ENTRY("CHARACTER_SET_SCHEMA", 20, m_szCharSetSchema)
	PROVIDER_COLUMN_ENTRY("CHARACTER_SET_NAME", 21, m_szCharSetName)
	PROVIDER_COLUMN_ENTRY("COLLATION_CATALOG", 22, m_szCollationCatalog)
	PROVIDER_COLUMN_ENTRY("COLLATION_SCHEMA", 23, m_szCollationSchema)
	PROVIDER_COLUMN_ENTRY("COLLATION_NAME", 24, m_szCollationName)
	PROVIDER_COLUMN_ENTRY("DOMAIN_CATALOG", 25, m_szDomainCatalog)
	PROVIDER_COLUMN_ENTRY("DOMAIN_SCHEMA", 26, m_szDomainSchema)
	PROVIDER_COLUMN_ENTRY("DOMAIN_NAME", 27, m_szDomainName)
	PROVIDER_COLUMN_ENTRY("DESCRIPTION", 28, m_szDescription)
END_PROVIDER_COLUMN_MAP()
				

STATUS

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

This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why  (http://kbalertz.com/Feedback.aspx?kbNumber=194022/EN-US/ )

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed  (http://kbalertz.com/Feedback.aspx?kbNumber=194295/EN-US/ )

MORE INFORMATION

For other changes to Atldb.h, please see the following KB articles:
201387 BUG: CTABLESRow Missing TABLE_PROPID Column  (http://kbalertz.com/Feedback.aspx?kbNumber=201387/EN-US/ )
198520 BUG: ATL OLE DB Provider Fails When Called From SQL 7.0 Query  (http://kbalertz.com/Feedback.aspx?kbNumber=198520/EN-US/ )

REFERENCES

Reference COLUMNS Rowset in the OLE DB Programmer's Reference for more information about schema and columns. In addition, see the OLE DB Consumer Templates documentation for information on the schema rowset classes CColumns and CColumnsInfo.

APPLIES TO
  • Microsoft OLE DB 2.7, when used with:
    • Microsoft Visual C++ 6.0 Enterprise Edition
    • Microsoft Visual C++ 6.0 Professional Edition
    • Microsoft Visual C++, 32-bit Learning Edition 6.0
Keywords: 
kbbug kbconsumer kbdatabase kbdtl kbfix kbmdacnosweep kbprovider kbvc600fix kbvs600sp3fix KB217188
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please