Released: Update to Microsoft OLE DB Driver 18 for SQL Server

Published Jun 21 2021 01:38 PM 1,694 Views
Senior Member

OLE DB Driver 18.6 for SQL Server is released, bringing support for Idle Connection Resiliency to the driver along with a number of fixes. The driver can be downloaded directly from Microsoft.

 

Changes:

Fixed:

Issue Details
Fixed an issue with endianness of port numbers in data access trace logs Fixed a bug, which resulted in port numbers logged having incorrect endianness while doing Data Access Tracing.
Fixed an accessibility issue Fixed an accessibility issue in the user interface of Universal Data Link (UDL). This accessibility issue resulted in the Browse button not being announced by screen reader software.
Fixed crash in scenarios involving Multiple Active Result Sets Fixed a bug, which could result in the driver crashing in some scenarios involving Multiple Active Result Sets (MARS).
 
The updated driver can be downloaded directly from Microsoft.

David Engel
2 Comments
Occasional Visitor

Does MSOLEDBSQL support  multiple  SQL Statement run at one time? 

i.e. if bstrSQL = "'USE myDB; CREATE TABLE dbo.Connections([ConnectionID] nvarchar (64) NOT NULL ,[Serial] int NULL ,[RestartStr] nvarchar (255) NULL ,[ProjectName] nvarchar (16) NOT NULL ,[Created] [datetime] NOT NULL DEFAULT (getdate()),[SampleId] nvarchar (64) NULL)"",  there is are no errors if I had already created Table "Connections".

 

C++ code slice:

try
{
m_pADODBErrors = NULL;
m_lErrorIndex = 0;

TCHAR connStr[1024];
_tcscpy(connStr, _T("Provider=MSOLEDBSQL;Server="));
_tcscat(connStr, bstrDBServer);
_tcscat(connStr, _T(";dsn=;Trusted_Connection=yes;"));
// increate default 15 seconds timeout to 2 minutes
pConnection->ConnectionTimeout = 120;
pConnection->Open(connStr, _T(""), _T(""), ADODB::adConnectUnspecified);
pConnection->Execute(bstrSQL, NULL, ADODB::adCmdText);
}
catch (...)
{

Senior Member

@chjhaijiang Yes, MSOLEDBSQL supports multiple statements in a single command. However, you need to process all result sets, check return codes, and process error information in order to ensure you receive all errors that might be generated by subsequent result sets. In your case, the first statement (USE myDB;) generates the first result set and does not generate any errors. See the documented comments on the IMultipleResults::GetResult OLE DB interface for good descriptions of when errors might occur. The Using IMultipleResults to Process Multiple Result Sets is another good place to start to read about how to consume multiple result sets.

 

Regards,

David

%3CLINGO-SUB%20id%3D%22lingo-sub-2467333%22%20slang%3D%22en-US%22%3EReleased%3A%20Update%20to%20Microsoft%20OLE%20DB%20Driver%2018%20for%20SQL%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2467333%22%20slang%3D%22en-US%22%3E%3CDIV%3E%0A%3CP%3EOLE%20DB%20Driver%2018.6%20for%20SQL%20Server%20is%20released%2C%20bringing%20support%20for%20Idle%20Connection%20Resiliency%20to%20the%20driver%20along%20with%20a%20number%20of%20fixes.%20The%26nbsp%3Bdriver%20can%20be%20%3CA%20title%3D%22download%20Microsoft%20OLE%20DB%20Driver%20for%20SQL%20Server%22%20href%3D%22https%3A%2F%2Faka.ms%2Fdownloadmsoledbsql%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Edownloaded%20directly%20from%20Microsoft%3C%2FA%3E.%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EChanges%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAdded%20support%20for%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fsql%2Fconnect%2Foledb%2Ffeatures%2Fidle-connection-resiliency%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EIdle%20Connection%20Resiliency%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ERemoved%20dependency%20on%20SQL%20Server%20tools%20for%20reading%20BCP%20XML%20format%20files%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSTRONG%3EFixed%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CTABLE%20width%3D%22100%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2244.60431654676259%25%22%3E%3CSTRONG%3EIssue%3C%2FSTRONG%3E%3C%2FTD%3E%0A%3CTD%20width%3D%2255.292908530318606%25%22%3E%3CSTRONG%3EDetails%3C%2FSTRONG%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2244.60431654676259%25%22%3E%3CSPAN%3EFixed%20an%20issue%20with%20endianness%20of%20port%20numbers%20in%20data%20access%20trace%20logs%3C%2FSPAN%3E%3C%2FTD%3E%0A%3CTD%20width%3D%2255.292908530318606%25%22%3E%3CSPAN%3EFixed%20a%20bug%2C%20which%20resulted%20in%20port%20numbers%20logged%20having%20incorrect%20endianness%20while%20doing%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fprevious-versions%2Fsql%2Fsql-server-2008%2Fcc765421(v%3Dsql.100)%22%20data-linktype%3D%22absolute-path%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EData%20Access%20Tracing%3C%2FA%3E%3CSPAN%3E.%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2244.60431654676259%25%22%3E%3CSPAN%3EFixed%20an%20accessibility%20issue%3C%2FSPAN%3E%3C%2FTD%3E%0A%3CTD%20width%3D%2255.292908530318606%25%22%3E%3CSPAN%3EFixed%20an%20accessibility%20issue%20in%20the%20user%20interface%20of%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Fconnect%2Foledb%2Fhelp-topics%2Fdata-link-pages%3Fview%3Dsql-server-ver15%22%20data-linktype%3D%22relative-path%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EUniversal%20Data%20Link%20(UDL)%3C%2FA%3E%3CSPAN%3E.%20This%20accessibility%20issue%20resulted%20in%20the%26nbsp%3B%3C%2FSPAN%3E%3CEM%3EBrowse%3C%2FEM%3E%3CSPAN%3E%26nbsp%3Bbutton%20not%20being%20announced%20by%20screen%20reader%20software.%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2244.60431654676259%25%22%3E%3CSPAN%3EFixed%20crash%20in%20scenarios%20involving%20Multiple%20Active%20Result%20Sets%3C%2FSPAN%3E%3C%2FTD%3E%0A%3CTD%20width%3D%2255.292908530318606%25%22%3E%3CSPAN%3EFixed%20a%20bug%2C%20which%20could%20result%20in%20the%20driver%20crashing%20in%20some%20scenarios%20involving%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Fconnect%2Foledb%2Ffeatures%2Fusing-multiple-active-result-sets-mars%3Fview%3Dsql-server-ver15%22%20data-linktype%3D%22relative-path%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMultiple%20Active%20Result%20Sets%20(MARS)%3C%2FA%3E%3CSPAN%3E.%3C%2FSPAN%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EThe%20updated%20driver%20can%20be%20%3CA%20title%3D%22download%20Microsoft%20OLE%20DB%20Driver%20for%20SQL%20Server%22%20href%3D%22https%3A%2F%2Faka.ms%2Fdownloadmsoledbsql%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Edownloaded%20directly%20from%20Microsoft%3C%2FA%3E.%3CBR%20%2F%3E%3CBR%20%2F%3EDavid%20Engel%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2467333%22%20slang%3D%22en-US%22%3E%3CP%3EOLE%20DB%20Driver%2018.6%20for%20SQL%20Server%20is%20released%2C%20bringing%20support%20for%20Idle%20Connection%20Resiliency%20to%20the%20driver.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2467333%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESQLServerDrivers%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2476081%22%20slang%3D%22en-US%22%3ERe%3A%20Released%3A%20Update%20to%20Microsoft%20OLE%20DB%20Driver%2018%20for%20SQL%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2476081%22%20slang%3D%22en-US%22%3E%3CP%3EDoes%26nbsp%3BMSOLEDBSQL%20support%26nbsp%3B%20multiple%26nbsp%3B%20SQL%20Statement%20run%20at%20one%20time%3F%26nbsp%3B%3C%2FP%3E%3CP%3Ei.e.%20if%26nbsp%3BbstrSQL%20%3D%20%22'USE%20myDB%3B%20CREATE%20TABLE%20dbo.Connections(%5BConnectionID%5D%20nvarchar%20(64)%20NOT%20NULL%20%2C%5BSerial%5D%20int%20NULL%20%2C%5BRestartStr%5D%20nvarchar%20(255)%20NULL%20%2C%5BProjectName%5D%20nvarchar%20(16)%20NOT%20NULL%20%2C%5BCreated%5D%20%5Bdatetime%5D%20NOT%20NULL%20DEFAULT%20(getdate())%2C%5BSampleId%5D%20nvarchar%20(64)%20NULL)%22%22%2C%26nbsp%3B%20there%20is%20are%20no%20errors%20if%20I%20had%20already%20created%20Table%20%22Connections%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EC%2B%2B%20code%20slice%3A%3C%2FP%3E%3CP%3Etry%3CBR%20%2F%3E%7B%3CBR%20%2F%3Em_pADODBErrors%20%3D%20NULL%3B%3CBR%20%2F%3Em_lErrorIndex%20%3D%200%3B%3C%2FP%3E%3CP%3ETCHAR%20connStr%5B1024%5D%3B%3CBR%20%2F%3E_tcscpy(connStr%2C%20_T(%22Provider%3DMSOLEDBSQL%3BServer%3D%22))%3B%3CBR%20%2F%3E_tcscat(connStr%2C%20bstrDBServer)%3B%3CBR%20%2F%3E_tcscat(connStr%2C%20_T(%22%3Bdsn%3D%3BTrusted_Connection%3Dyes%3B%22))%3B%3CBR%20%2F%3E%2F%2F%20increate%20default%2015%20seconds%20timeout%20to%202%20minutes%3CBR%20%2F%3EpConnection-%26gt%3BConnectionTimeout%20%3D%20120%3B%3CBR%20%2F%3EpConnection-%26gt%3BOpen(connStr%2C%20_T(%22%22)%2C%20_T(%22%22)%2C%20ADODB%3A%3AadConnectUnspecified)%3B%3CBR%20%2F%3EpConnection-%26gt%3BExecute(bstrSQL%2C%20NULL%2C%20ADODB%3A%3AadCmdText)%3B%3CBR%20%2F%3E%7D%3CBR%20%2F%3Ecatch%20(...)%3CBR%20%2F%3E%7B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Co-Authors
Version history
Last update:
‎Jun 21 2021 01:38 PM
Updated by: