Article ID: 216810 - View products that this article applies to.
This article was previously published under Q216810
This article has been archived. It is offered "as is" and will no longer be updated.
The Microsoft ODBC Driver for DB2 and the Microsoft OLE DB Provider for DB2, which are implemented as an IBM Distributed Relational Database Architecture (DRDA) Application Requester, use packages to issue dynamic SQL statements.
The driver and the provider will create packages dynamically in the location to which the user points using the Package Collection attribute. If either the user doesn't have the appropriate authority to create packages in designated "location" or the designated location does not exist, the provider or the driver might report the following error:
By default, the provider will automatically create one package in the target collection, if one does not exist, at the time the user issues the first SQL statement. The package is created with GRANT EXECUTE authority to a single AUTH_ID only, where AUTH_ID is based on the User ID value configured in the data source. The package is created for use by SQL statements issued under the same isolation level based on the Isolation Level value configured in the data source.
A SQL error has occurred. Please consult the documentation for your specific DB2 version for a description of the associated Native Error and SQL State. SQLSTATE: 51002, SQLCODE: -805.
Some users might specify a Package Collection value that represents a DB2 collection used by multiple users. This can be a problem if two or more users with different User IDs try to access a single collection of packages. The first user will have access to the packages, but the second user likely will not. The provider includes a command line utility for the administrator to create packages, called Crtpkg.exe (command line) as well as a graphical user interface version, Crtpkgw.exe (Windows GUI). These utilities can be run using a privileged User ID to create packages in collections accessed by multiple users. These utilities will create five sets of packages and grant EXECUTE privilege to PUBLIC for all:
The following is a successful run of Crtpkg.exe from the command line:
The GUI-based tool, Crtpkgw.exe, will read a Microsoft Data Link (UDL) file for connection configuration information. After selecting the appropriate Data Link file, select Create Package from the menu to create the five packages and grant rights to PUBLIC.