Skip to content

Commit f2b843c

Browse files
author
Ben Azizi
committed
Update release notes + Fix issues in docs
1 parent 38e03e9 commit f2b843c

4 files changed

Lines changed: 116 additions & 122 deletions

File tree

docs/connect/oledb/features/using-data-classification.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Using Data Classification with Microsoft OLE DB Driver for SQL Server | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "08/28/2020"
4+
ms.date: "09/30/2020"
55
ms.prod: sql
66
ms.prod_service: connectivity
77
ms.reviewer: ""
@@ -23,6 +23,9 @@ manager: kenvh
2323

2424
For more information on how to assign classification to columns, see [SQL Data Discovery and Classification](https://docs.microsoft.com/sql/relational-databases/security/sql-data-discovery-and-classification).
2525

26+
> [!NOTE]
27+
> Since the ISSDataClassification interface exposes classification information obtained from the server, obtaining this interface through [in-memory rowsets](..\ole-db-table-valued-parameters\table-valued-parameter-rowset-creation.md#table-valued-parameter-rowset-creation) is not applicable, therefore, not supported.
28+
2629
## Code samples
2730

2831
The following [!INCLUDE[tsql](../../../includes/tsql-md.md)] queries can be executed in SSMS to set up the prerequisites for the sample C++ application:
@@ -36,8 +39,8 @@ GO
3639

3740
CREATE TABLE [dbo].[mytable](
3841
[col1] [int] NULL,
39-
[col2] [int] NULL,
40-
) ON [PRIMARY]
42+
[col2] [int] NULL
43+
)
4144
GO
4245

4346
ADD SENSITIVITY CLASSIFICATION TO [dbo].[mytable].[col1] WITH (label = 'Label1', label_id = 'LabelId1', information_type = 'Type1', information_type_id = 'TypeId1', rank = Medium)

docs/connect/oledb/ole-db-how-to/integrated-kerberos-authentication-ole-db.md

Lines changed: 104 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Integrated Kerberos authentication (OLE DB driver) | Microsoft Docs"
33
description: Learn how to get mutual Kerberos authentication by using OLE DB in OLE DB Driver for SQL Server with this example.
44
ms.custom: ""
5-
ms.date: "06/14/2018"
5+
ms.date: "09/30/2020"
66
ms.prod: sql
77
ms.prod_service: "database-engine, sql-database, sql-data-warehouse, pdw"
88
ms.reviewer: ""
@@ -27,117 +27,106 @@ ms.author: v-daenge
2727

2828
Make sure your INCLUDE environment variable includes the directory that contains msoledbsql.h. Compile with ole32.lib oleaut32.lib.
2929

30-
```
31-
// compile with: ole32.lib oleaut32.lib
32-
#pragma once
33-
34-
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
35-
#include <stdio.h>
36-
#include <tchar.h>
37-
#include <msoledbsql.h>
38-
39-
#define CHECKHR(stmt) \
40-
do { \
41-
hr = (stmt); \
42-
if (FAILED(hr)) { \
43-
printf("CHECK_HR " #stmt " failed at (%hs, %d), hr=0x%08X\r\n", __FILE__, __LINE__, hr); \
44-
goto CleanUp; \
45-
} \
46-
} while(0)
47-
48-
#define CHECKVB(stmt) \
49-
do { \
50-
if ((stmt)!= VARIANT_TRUE) { \
51-
printf("CHECK_VB " #stmt " failed at (%hs, %d)\r\n", __FILE__, __LINE__); \
52-
goto CleanUp; \
53-
} \
54-
} while(0)
55-
56-
#define CHECKBOOL(stmt) \
57-
do { \
58-
if (!(stmt)) { \
59-
printf("CHECK_BOOL " #stmt " failed at (%hs, %d)\r\n", __FILE__, __LINE__); \
60-
goto CleanUp; \
61-
} \
62-
} while(0)
63-
64-
#define CHECKNULL(stmt) \
65-
do { \
66-
if ((stmt) == NULL) { \
67-
printf("CHECK_NULL " #stmt " failed at (%hs, %d)\r\n", __FILE__, __LINE__); \
68-
goto CleanUp; \
69-
} \
70-
} while(0)
71-
72-
#define SAFERELEASE(p) \
73-
do { \
74-
if ((p)!= NULL) { \
75-
p->Release(); \
76-
p = NULL; \
77-
} \
78-
} while(0)
79-
80-
#define SAFE_SYSFREESTRING(p) \
81-
do { \
82-
if ((p)!= NULL) { \
83-
::SysFreeString(p); \
84-
p = NULL; \
85-
} \
86-
} while(0)
87-
88-
int _tmain(int argc, _TCHAR* argv[]) {
89-
HRESULT hr = S_OK;
90-
IDBInitialize* pInitialize = NULL;
91-
IDBProperties* pProperties = NULL;
92-
DBPROPSET PropertySet[1];
93-
DBPROP rgdbprop[1];
94-
LPCWSTR lpwszProviderString = L"Server=MyServer;" // server with SQL Server 2008 (or later)
95-
L"Trusted_Connection=Yes;"
96-
L"ServerSPN=CP_SPN;"; // customer-provided SPN
97-
DBPROPID rgdbPropID[2];
98-
DBPROPIDSET rgdbPropIDSet[1];
99-
ULONG cPropertySets;
100-
DBPROPSET *prgPropertySets;
101-
102-
CHECKHR(CoInitialize(NULL));
103-
CHECKHR(CoCreateInstance(CLSID_MSOLEDBSQL, NULL, CLSCTX_INPROC_SERVER, __uuidof(IDBProperties), reinterpret_cast<void **>(&pProperties)));
104-
105-
// set provider string
106-
rgdbprop[0].dwPropertyID = DBPROP_INIT_PROVIDERSTRING;
107-
rgdbprop[0].dwOptions = DBPROPOPTIONS_REQUIRED;
108-
rgdbprop[0].colid = DB_NULLID;
109-
VariantInit(&(rgdbprop[0].vValue));
110-
V_VT(&(rgdbprop[0].vValue)) = VT_BSTR;
111-
V_BSTR(&(rgdbprop[0].vValue)) = SysAllocString(lpwszProviderString);
112-
113-
// set the property to the property set
114-
PropertySet[0].rgProperties = &rgdbprop[0];
115-
PropertySet[0].cProperties = 1;
116-
PropertySet[0].guidPropertySet = DBPROPSET_DBINIT;
117-
118-
// set properties and connect to server
119-
CHECKHR(pProperties->SetProperties(1, PropertySet));
120-
CHECKHR(pProperties->QueryInterface(__uuidof(pInitialize), (void **)&pInitialize));
121-
CHECKHR(pInitialize->Initialize());
122-
123-
// get properties
124-
rgdbPropID[0] = SSPROP_INTEGRATEDAUTHENTICATIONMETHOD;
125-
rgdbPropID[1] = SSPROP_MUTUALLYAUTHENTICATED;
126-
rgdbPropIDSet[0].rgPropertyIDs = &rgdbPropID[0];
127-
rgdbPropIDSet[0].cPropertyIDs = 2;
128-
rgdbPropIDSet[0].guidPropertySet = DBPROPSET_SQLSERVERDATASOURCEINFO;
129-
130-
CHECKHR(pProperties->GetProperties(1, rgdbPropIDSet, &cPropertySets, &prgPropertySets));
131-
wprintf(L"Authentication method: %s\r\n", (LPWSTR)V_BSTR(&(prgPropertySets[0].rgProperties[0].vValue)));
132-
wprintf(L"Mutually authenticated: %s\r\n", (VT_BOOL == V_VT(&(prgPropertySets[0].rgProperties[1].vValue)))?L"yes":L"no");
133-
134-
CleanUp:
135-
SAFERELEASE(pProperties);
136-
SAFERELEASE(pInitialize);
137-
138-
VariantClear(&(rgdbprop[0].vValue));
139-
CoUninitialize();
140-
}
141-
```
142-
143-
30+
```cpp
31+
// compile with: ole32.lib oleaut32.lib
32+
#pragma once
33+
34+
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
35+
#include <stdio.h>
36+
#include <tchar.h>
37+
#include <msoledbsql.h>
38+
39+
#define CHECKHR(stmt) \
40+
do\
41+
{\
42+
hr = (stmt);\
43+
if (FAILED(hr))\
44+
{\
45+
printf("CHECK_HR " #stmt " failed at (%hs, %d), hr=0x%08X\r\n", __FILE__, __LINE__, hr); \
46+
goto CleanUp; \
47+
} \
48+
} while (0)
49+
50+
#define SAFERELEASE(p) \
51+
do\
52+
{\
53+
if ((p) != nullptr)\
54+
{\
55+
p->Release(); \
56+
p = nullptr; \
57+
} \
58+
} while (0)
59+
60+
61+
int _tmain(int argc, _TCHAR* argv[])
62+
{
63+
HRESULT hr = S_OK;
64+
IDBInitialize* pInitialize = nullptr;
65+
IDBProperties* pProperties = nullptr;
66+
DBPROP rgdbprop[1] = {};
67+
LPCWSTR lpwszProviderString = L"Server=MyServer;" // server with SQL Server 2008 (or later)
68+
L"Trusted_Connection=Yes;"
69+
L"ServerSPN=CP_SPN;"; // customer-provided SPN
70+
71+
DBPROPSET* prgPropertySets = nullptr;
72+
ULONG cPropertySets = 0;
73+
74+
CHECKHR(CoInitialize(nullptr));
75+
CHECKHR(CoCreateInstance(CLSID_MSOLEDBSQL, nullptr, CLSCTX_INPROC_SERVER, __uuidof(IDBProperties), reinterpret_cast<void**>(&pProperties)));
76+
77+
// set provider string
78+
rgdbprop[0].dwPropertyID = DBPROP_INIT_PROVIDERSTRING;
79+
rgdbprop[0].dwOptions = DBPROPOPTIONS_REQUIRED;
80+
rgdbprop[0].colid = DB_NULLID;
81+
VariantInit(&(rgdbprop[0].vValue));
82+
V_VT(&(rgdbprop[0].vValue)) = VT_BSTR;
83+
V_BSTR(&(rgdbprop[0].vValue)) = SysAllocString(lpwszProviderString);
84+
85+
{ // set the property to the property set
86+
DBPROPSET PropertySet[1] = {};
87+
PropertySet[0].rgProperties = &rgdbprop[0];
88+
PropertySet[0].cProperties = 1;
89+
PropertySet[0].guidPropertySet = DBPROPSET_DBINIT;
90+
91+
// set properties and connect to server
92+
CHECKHR(pProperties->SetProperties(sizeof(PropertySet)/sizeof(DBPROPSET), PropertySet));
93+
}
94+
95+
CHECKHR(pProperties->QueryInterface<IDBInitialize>(&pInitialize));
96+
CHECKHR(pInitialize->Initialize());
97+
98+
{ // get properties
99+
DBPROPIDSET rgdbPropIDSet[1] = {};
100+
101+
DBPROPID rgdbPropID[2] = {};
102+
rgdbPropID[0] = SSPROP_INTEGRATEDAUTHENTICATIONMETHOD;
103+
rgdbPropID[1] = SSPROP_MUTUALLYAUTHENTICATED;
104+
105+
rgdbPropIDSet[0].rgPropertyIDs = &rgdbPropID[0];
106+
rgdbPropIDSet[0].cPropertyIDs = 2;
107+
rgdbPropIDSet[0].guidPropertySet = DBPROPSET_SQLSERVERDATASOURCEINFO;
108+
CHECKHR(pProperties->GetProperties(1, rgdbPropIDSet, &cPropertySets, &prgPropertySets));
109+
}
110+
wprintf(L"Authentication method: %s\r\n", V_BSTR(&(prgPropertySets[0].rgProperties[0].vValue)));
111+
wprintf(L"Mutually authenticated: %s\r\n",
112+
(V_BOOL(&(prgPropertySets[0].rgProperties[1].vValue)) == VARIANT_TRUE) ? L"yes" : L"no");
113+
114+
CleanUp:
115+
SAFERELEASE(pProperties);
116+
SAFERELEASE(pInitialize);
117+
118+
if (prgPropertySets)
119+
{
120+
for (ULONG iPropSet = 0; iPropSet < cPropertySets; ++iPropSet)
121+
{
122+
for (ULONG iProp = 0; iProp < prgPropertySets[iPropSet].cProperties; ++iProp)
123+
{
124+
VariantClear(&prgPropertySets[iPropSet].rgProperties[iProp].vValue);
125+
}
126+
}
127+
}
128+
129+
VariantClear(&(rgdbprop[0].vValue));
130+
CoUninitialize();
131+
}
132+
```

docs/connect/oledb/ole-db/service-principal-names-spns-in-client-connections-ole-db.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Service Principal Names (SPNs) in Client Connections (OLE DB) | Microsoft Docs"
33
description: Learn about OLE DB Driver for SQL Server properties and member functions that support service principal names in client applications.
44
ms.custom: ""
5-
ms.date: "06/12/2018"
5+
ms.date: "09/30/2020"
66
ms.prod: sql
77
ms.prod_service: "database-engine, sql-database, sql-data-warehouse, pdw"
88
ms.reviewer: ""
@@ -41,7 +41,7 @@ ms.author: v-daenge
4141
|Name|Type|Usage|
4242
|----------|----------|-----------|
4343
|SSPROP_INTEGRATEDAUTHENTICATIONMETHOD|VT_BSTR, readonly|Returns the authentication method used for the connection. The value returned to the application is the value that Windows returns to OLE DB Driver for SQL Server. The following are possible values: <br />"NTLM", which is returned when a connection is opened using NTLM authentication.<br />"Kerberos", which is returned when a connection is opened using Kerberos authentication.<br /><br /> If a connection has been opened and the authentication method cannot be determined, VT_EMPTY is returned.<br /><br /> This property can only be read when a data source has been initialized. If you attempt to read the property before a data source has been initialized, IDBProperties::GetProperies will return DB_S_ERRORSOCCURRED or DB_E_ERRORSOCCURRED, as appropriate, and DBPROPSTATUS_NOTSUPPORTED will be set in DBPROPSET_PROPERTIESINERROR for this property. This behavior is in accordance with the OLE DB core specification.|
44-
|SSPROP_MUTUALLYAUTHENICATED|VT_BOOL, readonly|Returns VARIANT_TRUE if the servers on the connection were mutually authenticated; otherwise, returns VARIANT_FALSE.<br /><br /> This property can only be read when a data source has been initialized. If there is an attempt to read the property before a data source has been initialized, IDBProperties::GetProperies will return DB_S_ERRORSOCCURRED or DB_E_ERRORSOCCURRED, as appropriate, and DBPROPSTATUS_NOTSUPPORTED will be set in DBPROPSET_PROPERTIESINERROR for this property. This behavior is in accordance with the OLE DB core specification<br /><br /> If this attribute is queried for a connection that did not use Windows Authentication, VARIANT_FALSE is returned.|
44+
|SSPROP_MUTUALLYAUTHENTICATED|VT_BOOL, readonly|Returns VARIANT_TRUE if the servers on the connection were mutually authenticated; otherwise, returns VARIANT_FALSE.<br /><br /> This property can only be read when a data source has been initialized. If there is an attempt to read the property before a data source has been initialized, IDBProperties::GetProperies will return DB_S_ERRORSOCCURRED or DB_E_ERRORSOCCURRED, as appropriate, and DBPROPSTATUS_NOTSUPPORTED will be set in DBPROPSET_PROPERTIESINERROR for this property. This behavior is in accordance with the OLE DB core specification<br /><br /> If this attribute is queried for a connection that did not use Windows Authentication, VARIANT_FALSE is returned.|
4545

4646
## OLE DB API Support for SPNs
4747
The following table describes the OLE DB member functions that support SPNs in client connections:

docs/connect/oledb/release-notes-for-oledb-driver-for-sql-server.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Release notes for OLE DB Driver"
33
description: "This release notes article describes the changes in each release of the Microsoft OLE DB Driver for SQL Server."
4-
ms.date: "08/28/2020"
4+
ms.date: "09/30/2020"
55
ms.prod: sql
66
ms.technology: connectivity
77
ms.topic: conceptual
@@ -43,7 +43,9 @@ If you need to download the installer in a language other than the one detected
4343

4444
| Bug fixed | Details |
4545
| :-------- | :------ |
46-
| Fixed an issue with embedded NUL characters. | Fixed a bug which resulted in the driver returning an incorrect length of strings with embedded NUL characters. |
46+
| Fixed an issue with embedded NUL characters. | Fixed a bug, which resulted in the driver returning an incorrect length of strings with embedded NUL characters. |
47+
| Fixed a memory leak in the [IBCPSession](ole-db-interfaces/ibcpsession-ole-db.md) interface. | Fixed a memory leak in the [IBCPSession](ole-db-interfaces/ibcpsession-ole-db.md) interface involving bulk copy operations of `sql_variant` data type. |
48+
| Fixed bugs, which resulted in `SSPROP_INTEGRATEDAUTHENTICATIONMETHOD` and `SSPROP_MUTUALLYAUTHENTICATED` properties not returning correct values. | Fix bugs, which resulted in incorrect values being returned when attempting to read the values of these properties. Details about these properties can be found [here](ole-db\service-principal-names-spns-in-client-connections-ole-db.md#data-source-properties).|
4749

4850
## Previous Releases
4951

0 commit comments

Comments
 (0)