FIX: Visual C++ ATL Provider Fails when Used with SQL DTS (198921)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft SQL Server 7.0
This article was previously published under Q198921 SYMPTOMS
SQL Server version 7.0 Data Transformation Services (DTS) works with an OLE DB provider as a source or destination. If you use DTS Import Wizard with a Visual C++ ATL wizard-generated OLE DB Provider as source, when you execute the package the following error occurs:
Required connection properties have not been specified in a connection object.
CAUSE
This is caused by a bug in the ATL Provider templates. The ATL Provider templates incorrectly returns initialization properties when IDBProperties::GetPropertyInfo() is called with the property set GUID is set to DBPROPSET_DBINITALL.
RESOLUTION
To resolve this problem, upgrade to Microsoft Visual Studio 6.0 Service Pack 3.0.
Also, to get DTS to import from the default ATL wizard-generated provider, do the following:
- In the Select Source Tables window, the SQL Destination table name is shown as [databasename].[dbo].[*]. Change the table name "*" to another valid identifier.
- Change the destination data-types. This can be accomplished in one of two ways:
- Change the T-SQL Syntax
- Click Transform in the Select Source Tables window. The Wizard shows decimal destination type for FileAttributes, FileSizeHigh, and FileSizeLow columns in the source.
- Change data type of FileAttributes to Varchar(4).
- Change data type of FileSizeHigh and FileSizeLow to int.
- Change the provider column map
In the file that has the declaration for CFilesWindowsFile (FilesRS.h) change the
property map for the rowset to more accurately specify the source datatypes.
PROVIDER_COLUMN_ENTRY_FIXED("FileAttributes", 1, DBTYPE_I4, dwFileAttributes)
PROVIDER_COLUMN_ENTRY_FIXED("FileSizeHigh", 2, DBTYPE_I4, nFileSizeHigh)
PROVIDER_COLUMN_ENTRY_FIXED("FileSizeLow", 3, DBTYPE_I4, nFileSizeLow)
PROVIDER_COLUMN_ENTRY_STR("FileName", 4, cFileName)
PROVIDER_COLUMN_ENTRY_STR("AltFileName", 5, cAlternateFileName)
- Complete the remaining steps and the data should be copied correctly.
Another workaround is to specify SQL Server as the data source instead of ATL provider in the DTS Import Wizard. Then, select the Use a query to specify the data option and use a distributed query to retrieve data from the ATL provider. Following is an example query:
Select * from Openrowset ('MyProv.MyProv', '','c:\*.*')
NOTE: You must apply the fixes in Service Pack 3.0 to enable the provider to work with a SQL distributed query.
STATUSThis bug was corrected in Visual Studio 6.0 Service Pack 3.0. REFERENCES
For additional information about fixes needed to use ATL OLEDB provider with SQL 7.0 distributed query, please see the following
articles in the Microsoft Knowledge Base:
200921 OpenQuery with ATL Provider Fails When Set Up with SEM
198520 ATL OLE DB Provider Fails When Called from SQL 7.0 Query
Modification Type: | Major | Last Reviewed: | 10/24/2003 |
---|
Keywords: | kbBug kbDatabase kbfix kbMDACNoSweep kbVS600sp3fix KB198921 |
---|
|