<?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 Creating a Database Connection using JSL (and closing it) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Creating-a-Database-Connection-using-JSL-and-closing-it/m-p/616874#M81647</link>
    <description>&lt;P&gt;I am trying to Create a db connection and then close it when my script is complete.&amp;nbsp; I've copied the Connection string from the "Connection()" command in my "New SQL Query()" function and pasted it into the "Create Database Connection()" function.&amp;nbsp; But when I run the script I get an error in the log related to the definition of dbc1 that says "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my JSL script that I am trying to run and the old method that runs without a problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Notes:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&amp;nbsp;the CustomSQL in the Query is defined elsewhere and isn't shown to make this example shorter.&lt;/LI&gt;&lt;LI&gt;I was trying to follow the solution shown in this post:&amp;nbsp;&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/How-to-Disconnect-from-a-database-via-script/m-p/597749#M80126" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/Discussions/How-to-Disconnect-from-a-database-via-script/m-p/597749#M80126&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;UPDATE: I am running JMP 16.1 and get the error shown above.&amp;nbsp; When I run this in JMP 17.0, it works just fine.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

// trying to create the db connection and then insert into the Query
dbc1 = Create database Connection("ODBC:DSN=SQLplus 64-bit ODBC Connection;");
New SQL Query( 
	Connection( dbc1 ), 
	CustomSQL( combined ) 
) &amp;lt;&amp;lt; Run Foreground();


// vs. my typical method
New SQL Query( 
	Connection( "ODBC:DSN=SQLplus 64-bit ODBC Connection;" ), 
	CustomSQL( combined ) 
) &amp;lt;&amp;lt; Run Foreground();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 16:06:24 GMT</pubDate>
    <dc:creator>tbidwell</dc:creator>
    <dc:date>2023-06-09T16:06:24Z</dc:date>
    <item>
      <title>Creating a Database Connection using JSL (and closing it)</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-Database-Connection-using-JSL-and-closing-it/m-p/616874#M81647</link>
      <description>&lt;P&gt;I am trying to Create a db connection and then close it when my script is complete.&amp;nbsp; I've copied the Connection string from the "Connection()" command in my "New SQL Query()" function and pasted it into the "Create Database Connection()" function.&amp;nbsp; But when I run the script I get an error in the log related to the definition of dbc1 that says "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my JSL script that I am trying to run and the old method that runs without a problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Notes:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&amp;nbsp;the CustomSQL in the Query is defined elsewhere and isn't shown to make this example shorter.&lt;/LI&gt;&lt;LI&gt;I was trying to follow the solution shown in this post:&amp;nbsp;&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/How-to-Disconnect-from-a-database-via-script/m-p/597749#M80126" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/Discussions/How-to-Disconnect-from-a-database-via-script/m-p/597749#M80126&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;UPDATE: I am running JMP 16.1 and get the error shown above.&amp;nbsp; When I run this in JMP 17.0, it works just fine.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

// trying to create the db connection and then insert into the Query
dbc1 = Create database Connection("ODBC:DSN=SQLplus 64-bit ODBC Connection;");
New SQL Query( 
	Connection( dbc1 ), 
	CustomSQL( combined ) 
) &amp;lt;&amp;lt; Run Foreground();


// vs. my typical method
New SQL Query( 
	Connection( "ODBC:DSN=SQLplus 64-bit ODBC Connection;" ), 
	CustomSQL( combined ) 
) &amp;lt;&amp;lt; Run Foreground();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:06:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-Database-Connection-using-JSL-and-closing-it/m-p/616874#M81647</guid>
      <dc:creator>tbidwell</dc:creator>
      <dc:date>2023-06-09T16:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Database Connection using JSL (and closing it)</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-Database-Connection-using-JSL-and-closing-it/m-p/617559#M81709</link>
      <description>&lt;P&gt;JMP support found the problem.&amp;nbsp; I copied the connection string from the New SQL Query() script from Query Builder.&amp;nbsp; The Create database connection() function doesn't allow the 'ODBC:' part of the DSN definition.&amp;nbsp; So, the JSL script needs to look like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

// trying to create the db connection and then insert into the Query
dbc1 = Create database Connection("DSN=SQLplus 64-bit ODBC Connection;");
New SQL Query( 
	Connection( dbc1 ), 
	CustomSQL( combined ) 
) &amp;lt;&amp;lt; Run Foreground();&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Mar 2023 18:00:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-Database-Connection-using-JSL-and-closing-it/m-p/617559#M81709</guid>
      <dc:creator>tbidwell</dc:creator>
      <dc:date>2023-03-28T18:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Database Connection using JSL (and closing it)</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-Database-Connection-using-JSL-and-closing-it/m-p/617566#M81710</link>
      <description>&lt;P&gt;Thank you to&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7749"&gt;@Dahlia_Watkins&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 18:04:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-Database-Connection-using-JSL-and-closing-it/m-p/617566#M81710</guid>
      <dc:creator>tbidwell</dc:creator>
      <dc:date>2023-03-28T18:04:19Z</dc:date>
    </item>
  </channel>
</rss>

