<?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: SQLQuery in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/SQLQuery/m-p/57563#M32134</link>
    <description>&lt;P&gt;Francoise,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is an Excel workbook (.xlsx), with 3 sheets, Basketball, Football and an empty Sheet 3. Basketball and Football are are sheet protected with the password 1234.&amp;nbsp; Run lines 1-13 (//Run to Here... ) of the embedded script, then open and change or add something to the Excel file sheet Football, then run line 15, the last JSL statement.&amp;nbsp; It works, but I get a prompt for which sheet. If I select Football my JMP table is updated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is likely there is syntax to specify which worksheet in the connect string, but I do not know it. If you have just one sheet, then this should work. Note I am using Excel as a database and not using Open (or Import Excel).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JMP 13 had documentation that Open/Import supported passwords for&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; "Import password-protected Excel 2007 .xls files by including the Password argument"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However,&amp;nbsp; when writing our book (written with JMP13) early&amp;nbsp; Jan 2017, we reported it did not work. There is no message of support in JMP 14 documentation.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note my system name (DSN=Excel Files) might not be the name you have set up, and you need to change the path to match the location where you saved this file. Hopefully, a JMP person or guru who has faced this issue can help with the issue of specifying the sheet in the connect string.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//---create a string with multiple commands
xls_connect_str = "DSN=Excel Files;
  DBQ=Basketball Football Sample Data.xlsx;
  DefaultDir=c:\temp\;pwd=1234";

//--select some fields/parameters/columns  

//--Football is one of the worksheet names
//--each worksheet is treated as a database table
football_dt1=Open Database( xls_connect_str,
  "SELECT * FROM `Football$`",
  "Football");  
//--- Run to Here and look at results 

football_dt1 &amp;lt;&amp;lt; Update from Database(xls_connect_str);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 19 May 2018 21:55:48 GMT</pubDate>
    <dc:creator>gzmorgan0</dc:creator>
    <dc:date>2018-05-19T21:55:48Z</dc:date>
    <item>
      <title>SQLQuery</title>
      <link>https://community.jmp.com/t5/Discussions/SQLQuery/m-p/57188#M32083</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've made a sqlquery.jmp from an excel file (xlsm).&lt;/P&gt;&lt;P&gt;When I execute for the first time: no pb. the jmp file is created.&lt;/P&gt;&lt;P&gt;but when I try to update the jmp file by "update from Database" (I use JMP14), the file is not updated.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The excel file is write protected. In excel, the file requests a password for writing / reading. I can only open it as read-only.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is it the explanation?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What should I check ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thanks for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;best regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 May 2018 08:56:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/SQLQuery/m-p/57188#M32083</guid>
      <dc:creator>Françoise</dc:creator>
      <dc:date>2018-05-18T08:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: SQLQuery</title>
      <link>https://community.jmp.com/t5/Discussions/SQLQuery/m-p/57563#M32134</link>
      <description>&lt;P&gt;Francoise,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is an Excel workbook (.xlsx), with 3 sheets, Basketball, Football and an empty Sheet 3. Basketball and Football are are sheet protected with the password 1234.&amp;nbsp; Run lines 1-13 (//Run to Here... ) of the embedded script, then open and change or add something to the Excel file sheet Football, then run line 15, the last JSL statement.&amp;nbsp; It works, but I get a prompt for which sheet. If I select Football my JMP table is updated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is likely there is syntax to specify which worksheet in the connect string, but I do not know it. If you have just one sheet, then this should work. Note I am using Excel as a database and not using Open (or Import Excel).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JMP 13 had documentation that Open/Import supported passwords for&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; "Import password-protected Excel 2007 .xls files by including the Password argument"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However,&amp;nbsp; when writing our book (written with JMP13) early&amp;nbsp; Jan 2017, we reported it did not work. There is no message of support in JMP 14 documentation.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note my system name (DSN=Excel Files) might not be the name you have set up, and you need to change the path to match the location where you saved this file. Hopefully, a JMP person or guru who has faced this issue can help with the issue of specifying the sheet in the connect string.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//---create a string with multiple commands
xls_connect_str = "DSN=Excel Files;
  DBQ=Basketball Football Sample Data.xlsx;
  DefaultDir=c:\temp\;pwd=1234";

//--select some fields/parameters/columns  

//--Football is one of the worksheet names
//--each worksheet is treated as a database table
football_dt1=Open Database( xls_connect_str,
  "SELECT * FROM `Football$`",
  "Football");  
//--- Run to Here and look at results 

football_dt1 &amp;lt;&amp;lt; Update from Database(xls_connect_str);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 May 2018 21:55:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/SQLQuery/m-p/57563#M32134</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-05-19T21:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: SQLQuery</title>
      <link>https://community.jmp.com/t5/Discussions/SQLQuery/m-p/59262#M32543</link>
      <description>&lt;P&gt;This is a late update. The reason for the prompt is that the Update From Database() needs both the connect string and the query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is just an FYI, to correct the prompting issue in my last post for this discussion.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);
//---create a string with multiple commands
xls_connect_str = "DSN=Excel Files;
  DBQ=Basketball Football Sample Data.xlsx;
  DefaultDir=c:\temp\;pwd=1234";

//--select some fields/parameters/columns  

//--Football is one of the worksheet names
//--each worksheet is treated as a database table
football_dt1=Open Database( xls_connect_str,
  "SELECT * FROM `Football$` ",
  "Football");  
//--- Run to Here and look at results 

nr= nrow(football_dt1);
football_dt1 &amp;lt;&amp;lt; delete rows((nr-10)::nr);

football_dt1 &amp;lt;&amp;lt; Update from Database(xls_connect_str , "SELECT * FROM `Football$` ");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 17:18:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/SQLQuery/m-p/59262#M32543</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-06-04T17:18:22Z</dc:date>
    </item>
  </channel>
</rss>

