Error Reading Tables

105 views
Skip to first unread message

bta...@stanford.edu

unread,
Feb 28, 2016, 9:05:45 PM2/28/16
to AMPL Modeling Language

Hello, I'm trying to read a table from Excel into AMPL.  It is 5020 rows long, so I really don't want to copy and paste it into my dat file.  I am operating Amplide on Mac OSX Yosemite.  Initially, I was told I had no accessible table reader, so I downloaded mySQL and both the 64 bit and 32 bit ODBCs offered for Macs.  I have installed mySQL and it is currently running (although, I never had to type in the temporary password it gave me).  Now, I and am trying to connect AMPL to mySQL so that I can use ODBC as a table reader.  This is the latest error I have been getting when trying to run my .run file using the code given by the mySQL website:


 Error at _cmdno 1 executing "read_table" command

(file EnGen.run, line 9, offset 260):


Error reading table Resources with table handler odbc:

Could not connect to "DRIVER=MySQL; DATABASE=test;".

 

Here is my .run file:


model EnGen.mod;


param ConnectionStr symbolic = "DRIVER=MySQL; DATABASE=test;";


table Resources IN "ODBC" (ConnectionStr) "Resources.xls":

TIME <- [TIME], Demand, SolarInsolation, WindSpeed, WindDirection, GridPrice;


read table Resources;


data  EnGen.dat;


option solver cplex;

solve;


Can I get some help on this please?

 

Thank You

Victor Zverovich

unread,
Feb 29, 2016, 5:02:14 PM2/29/16
to am...@googlegroups.com
To transfer data from Excel you'll need an ODBC driver for Excel, not MySQL. Connecting to Excel on OS X is covered in this thread: https://groups.google.com/d/msg/ampl/8sne3XHNUlw/qKN-CfxP_z8J

HTH,
Victor

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages