0
$\begingroup$

As example, the following very simple code works fine when I run it from Mathematica .nb, but fails to get the data from SQL when I create an (Enterprise) cdf from it:

Manipulate[
 hadb = SQLExecute[conn, "SELECT * FROM HV_refs", 
   "ShowColumnHeadings" -> True];
 idx = Position[hadb, ref][[1, 1]];
 abr = hadb[[idx, 2]];
 bcr = hadb[[idx, 3]];
 cdr = hadb[[idx, 4]];
 adr = hadb[[idx, 5]];
 Grid[{{" ", "p1", "p2", "p3", "p4"}, {ref, abr, bcr, cdr, adr}}, 
  Frame -> All],
 {{ref, hadb[[2, 1]], "Choose ref."}, hadb[[All, 1]], 
  ControlType -> PopupMenu},
 Initialization :> {Needs["DatabaseLink`"];
   conn = OpenSQLConnection["Mathematica_test_db"]}]

What am I missing here?

$\endgroup$
  • $\begingroup$ Where is "Mathematica_test_db"? $\endgroup$ – Kuba Apr 3 '17 at 12:12
  • $\begingroup$ Is available on a SQL server in our intranet (share place)... $\endgroup$ – Conrad Apr 3 '17 at 12:13
  • $\begingroup$ Maybe DatabaseResourcesPath is different in the player. (just guessing, have not tired that) $\endgroup$ – Kuba Apr 3 '17 at 12:16
  • $\begingroup$ Ok, how can I check that in CDF Player? $\endgroup$ – Conrad Apr 4 '17 at 6:04
  • $\begingroup$ You can CDFDeploy @ Dynamic[{DateString[], DatabaseResourcesPath[]}, UpdateInterval ->1] and check what does it show in the player. $\endgroup$ – Kuba Apr 4 '17 at 6:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.