Blog Post

SQL Server Blog
1 MIN READ

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

David-Engel's avatar
David-Engel
Iron Contributor
Jun 21, 2021

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
Published Jun 21, 2021
Version 1.0

2 Comments

  • David-Engel's avatar
    David-Engel
    Iron Contributor

    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

  • chjhaijiang's avatar
    chjhaijiang
    Copper Contributor

    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 (...)
    {