Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

ATL Provider Error ATL2011

Error Message

Only 1 inline unnamed attribute allowed per scope.

The provider has encountered multiple uses of an attribute of which only one is allowed to be unnamed.

Example

The following sample generates ATL2011 because it contains two unnamed db_source attributes and two unnamed db_command attributes.

// ATL2011.cpp
// compile with: /c
// ATL2011 expected
#define _ATL_ATTRIBUTES
#include <atlbase.h>
#include <atldbcli.h>
 
int main()
{
 [ db_source("<Connection string to connect to Northwind database>")];
// to resolve error, change preceding line to
// [ db_source("<Connection string to connect to Northwind database>",name="nwnd")];
 [ db_source("<Connection string to connect to some other database>")];

 char szFirstName[21];
 [ db_command(db_command="([bindto] szFirstName) select FirstName from Employees")];
 char szCustomerID[6];
 [ db_command(db_command="([bindto] szCustomerID) select CustomerID from Customers")];
// to resolve error, change preceding line to
// [ db_command(db_command="([bindto] szCustomerID) select CustomerID from Customers",name="custcmd")];
} 

Community Additions

ADD
Show:
© 2015 Microsoft