<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: LIBNAME Statement for the OLE DB Engine in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/968419#M376563</link>
    <description>&lt;P&gt;Is ODBC an option? We use SAS/ACCESS Interface to ODBC with SQL Server a lot and haven't had any problems upgrading to newer database or database driver versions at all.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Jun 2025 04:59:03 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2025-06-09T04:59:03Z</dc:date>
    <item>
      <title>LIBNAME Statement for the OLE DB Engine</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/967793#M376441</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm unable to create a LIBNAME statement equivalent to a PROC SQL "CONNECT TO" statement that works perfectly.&amp;nbsp; (I need a LIBNAME in order to use PROC APPEND.)&amp;nbsp; Both statements use the same OLE DB driver, database and user.&amp;nbsp; We are still at SAS version 9.4 M6, if that makes a difference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my&amp;nbsp;PROC SQL "CONNECT TO" statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CONNECT TO oledb (init_string="Provider=MSOLEDBSQL19; Server=MyServer; Database=MyDatabase; UID=MyUsername; PWD=MyPassword; Use Encryption for Data=Optional; Trust Server Certificate=True;");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my best guess at the equivalent LIBNAME statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LIBNAME MyLibrary OLEDB PROMPT=NO DATASOURCE=MyServer PROVIDER=MSOLEDBSQL19 SCHEMA=dbo USER=MyUsername PASSWORD=MyPassword PROPERTIES=('Use Encryption for Data'=Optional 'Trust Server Certificate'=True);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, it results in an "Invalid option name 'Use Encryption for Data'" error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NO MATTER WHAT I TRY, I SIMPLY CANNOT GET IT TO RECOGNIZE THE&amp;nbsp;"Use Encryption for Data" and "Trust Server Certificate" OLE DB OPTIONS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I don't specify those options, I get the following error due to a lack of a certificate:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error trying to establish connection: Unable to Initialize: Client unable to establish connection. For solutions related to&lt;BR /&gt;encryption errors, see &lt;A href="https://go.microsoft.com/fwlink/?linkid=2227882" target="_blank" rel="noopener"&gt;https://go.microsoft.com/fwlink/?linkid=2227882&lt;/A&gt;.: SSL Provider: The certificate chain was issued by&lt;BR /&gt;an authority that is not trusted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Prior to the upgrade of our database from SQL Server 2016 to SQL Server 2022 (and the upgrade from OLE DB driver SQLNCLI11 to MSOLEDBSQL19), the following LIBNAME statement worked:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LIBNAME MyLibrary OLEDB PROMPT=NO DATASOURCE=MyServer PROVIDER=SQLNCLI11 SCHEMA=dbo USER=MyUsername PASSWORD=MyPassword;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2025 14:47:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/967793#M376441</guid>
      <dc:creator>jonburk</dc:creator>
      <dc:date>2025-05-30T14:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME Statement for the OLE DB Engine</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/967882#M376453</link>
      <description>&lt;P&gt;What happens if you just run your old working code with the driver updated:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LIBNAME MyLibrary OLEDB PROMPT=NO DATASOURCE=MyServer PROVIDER='MSOLEDBSQL19' SCHEMA=dbo USER=MyUsername PASSWORD=MyPassword;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 31 May 2025 23:43:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/967882#M376453</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2025-05-31T23:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME Statement for the OLE DB Engine</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/967946#M376468</link>
      <description>&lt;P&gt;Running my old code with the new driver results in this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Error trying to establish connection: Unable to Initialize: Client unable to establish connection.&lt;/FONT&gt;&lt;/STRONG&gt; For solutions related to&lt;BR /&gt;encryption errors, see &lt;A href="https://go.microsoft.com/fwlink/?linkid=2227882" target="_blank"&gt;https://go.microsoft.com/fwlink/?linkid=2227882&lt;/A&gt;.: &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;SSL Provider: The certificate chain was issued by&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;an authority that is not trusted.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually don't need the "Trust Server Certificate=True" option.&amp;nbsp; I just need to be able to pass in the "Use Encryption for Data=Optional" option, but I can't figure out how to do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 14:21:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/967946#M376468</guid>
      <dc:creator>jonburk</dc:creator>
      <dc:date>2025-06-02T14:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME Statement for the OLE DB Engine</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/967989#M376477</link>
      <description>&lt;P&gt;Have you tried the INIT_STRING= parameter?&lt;BR /&gt;&lt;BR /&gt;Another option is to put all the infomation in an &lt;A href="https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/test-oledb-connectivity-use-udl-file" target="_self"&gt;UDL file&lt;/A&gt; and use option&amp;nbsp;&lt;SPAN&gt;UDL_FILE=. This way all the syntax is as dictated by Microsoft.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 23:40:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/967989#M376477</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2025-06-02T23:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME Statement for the OLE DB Engine</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/968353#M376534</link>
      <description>&lt;P&gt;I haven't tried a UDL file, but I did just try INIT_STRING and got the same error.&amp;nbsp; I also tried PROMPT=YES to bring up the interactive dialog box, but it couldn't do it either, despite having the encryption and server certificate options that I'm trying to set.&amp;nbsp; I'm going to wait until we upgrade to SAS 9.4 M9 before pursuing this further.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2025 18:26:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/968353#M376534</guid>
      <dc:creator>jonburk</dc:creator>
      <dc:date>2025-06-06T18:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME Statement for the OLE DB Engine</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/968376#M376544</link>
      <description>&lt;P&gt;Why not use UDL?&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jun 2025 10:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/968376#M376544</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2025-06-07T10:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME Statement for the OLE DB Engine</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/968419#M376563</link>
      <description>&lt;P&gt;Is ODBC an option? We use SAS/ACCESS Interface to ODBC with SQL Server a lot and haven't had any problems upgrading to newer database or database driver versions at all.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jun 2025 04:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/968419#M376563</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2025-06-09T04:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME Statement for the OLE DB Engine</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/968479#M376584</link>
      <description>&lt;P&gt;No, we only have&amp;nbsp;SAS/ACCESS Interface to OLE DB&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jun 2025 20:10:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/968479#M376584</guid>
      <dc:creator>jonburk</dc:creator>
      <dc:date>2025-06-09T20:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: LIBNAME Statement for the OLE DB Engine</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/968491#M376586</link>
      <description>&lt;P&gt;Not sure if this is any help to you but here are some examples of &lt;A href="https://www.connectionstrings.com/ole-db-driver-for-sql-server/" target="_blank" rel="noopener"&gt;OLE DB connection strings up to SQL Server version 2019.&lt;/A&gt;&amp;nbsp;These can be used as is using the LIBNAME NOPROMPT option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also have you tried something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname MyOLEDB oledb noprompt="Provider=MSOLEDBSQL19; Server=MyServer; Database=MyDatabase; UID=MyUsername; PWD=MyPassword; Use Encryption for Data=Optional; Trust Server Certificate=True;";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The connection string in your CONNECT statement should work unchanged in your LIBNAME statement.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jun 2025 22:27:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LIBNAME-Statement-for-the-OLE-DB-Engine/m-p/968491#M376586</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2025-06-09T22:27:49Z</dc:date>
    </item>
  </channel>
</rss>

