| FOOD | cost | f_min | f_max |
| BEEF | 3.19 | 2 | 10 |
| CHK | 2.59 | 2 | 10 |
reset;
set FOOD;
param cost {FOOD} > 0;
param f_min {FOOD} >= 0;
param f_max {j in FOOD} >= f_min[j];
table Foods IN "tableproxy" "odbc" "myfood.xls":
FOOD <- [FOOD], cost, f_min, f_max;
read table Foods;Error reading table Foods with table handler tableproxy:
Table `Foods` does not appear in "myfood.xls".Highlight the entire range of cells in myfood.xls where your table appears (including the first row with the column names), then click the Name Box at the left end of the formula bar -- where B7 appears in this screenshot:
Then type the table name -- Foods -- into the Name Box, and press Enter. Finally, save the updated spredsheet file and try reading it from AMPL again.
Bob Fourer
am...@googlegroups.com
Can you determine whether you are using 32-bit or 64-bit Excel 2016, and whether you are using 32-bit or 64-bit AMPL? It would be best to fix the error on reading the xlsx file first. Can you post AMPL and spreadsheet files that can be used to recreate the problem?
Bob Fourer
am...@googlegroups.com
From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of Giovanni Pavese
Sent: Wednesday, December 7, 2016 9:59 AM
To: AMPL Modeling Language
--
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.
The Excel files did not come through; can you attach them individually?
AMPL Support Services
sup...@ampl.com
From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of Giovanni Pavese
Sent: Wednesday, December 7, 2016 4:34 PM
To: am...@googlegroups.com
Subject: Re: [AMPL 13146] Re: Error reading table with tableproxy
Dear Bob,
you can find all my file attached to this email. These are confidential, so I ask you to not send to anyone.
I prefere to send you all files because, if you want, I will ask you another thing about my script.
However, the main file is linate.run, which loads the others.
- In the folder LIN you can find the Excel files.
- The file that imports what I need is Linate_import_ACDM.run: if you leave ".xls" the script works, but I can't write in it.
If you change the format in ".xlsx" you will obtain the error that I explained you.
- the file 3_Steps_Problem is a command file that contains a 3 steps optimization problem, where the steps are nested: the output of the first goes in the second and the third, and the output of the second goes into the third too.
- The file Linate_export_ACDM.run tries to write in the Excel file the output of the third problem. Considering that I can't do that, I used the "display" command, after the "break all" command (that I comment when needed, obvioulsy).
- I have attached a screenshot of my installation folder, hope it is helpful.
I apologize for my confusing and not professional script, and for the disturb.
As always, I thank you a lot.
Giovanni
--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/BtXnvst_8iE/unsubscribe.
To unsubscribe from this group and all its topics, 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.
--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/BtXnvst_8iE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ampl+unsubscribe@googlegroups.com.
table myDEPout OUT "ODBC" "LIN\prova.xls" # AMPL 32-bit, Excel 32-bit
[NON_DROPPED,PARKING,ROUTE]
{d in NON_DROPPED, (r,k) in PATHr[d]:r=entryp[d]} tr[d,r,k] ~ TSAT_opt;
write table myDEPout;
Error at _cmdno 2237 executing "write_table" command
(file Linate_export_ACDM.run, line 8, offset 369):
Linate_export_ACDM.run, line 8 (offset 381):
Error writing table myDEPout with table handler odbc:
DROP TABLE `myDEPout` failed.
Is another application using "LIN\prova.xls"?
context: write table >>> myDEPout; <<<
table myDEP IN "tableproxy" "odbc" "LIN\DEPqueryOutputProc.xls": # AMPL 64-bit, Excel 32-bit
allDEPARTURES <- [FLIGHT], PKB_dep ~ PKB, EOBT, TOBT;
read table myDEP;
table myARR IN "tableproxy" "odbc" "LIN\ARRqueryOutputProc.xls": # AMPL 64-bit, Excel 32-bit
allARRIVALS <- [FLIGHT], PKB_arr ~ PKB, ELDT, SIBT;
read table myARR;
table myDEPout OUT "ODBC" "LIN\DEPqueryOutputProc.xls" # AMPL 32-bit, Excel 32-bit but also OK PER 64!!!!!
[NON_DROPPED,PARKING,ROUTE]
{d in NON_DROPPED, (r,k) in PATHr[d]:r=entryp[d]} tr[d,r,k] ~ TSAT_opt;
write table myDEPout;
table myDEPout2 OUT "ODBC" "LIN\DEPqueryOutputProc.xls" # AMPL 32-bit, Excel 32-bit but also OK PER 64!!!!!
[NON_DROPPED,RWY]
{d in NON_DROPPED, i in PATHi[d]: i='RWY'} ti[d,i] ~ TTOT_opt;
write table myDEPout;
table myDEP IN "ODBC" "LIN\DEPqueryOutputProc.xls": # AMPL 32-bit, Excel 32-bit
allDEPARTURES <- [FLIGHT], PKB_dep ~ PKB, EOBT, TOBT;
read table myDEP;
table myARR IN "ODBC" "LIN\ARRqueryOutputProc.xls":
allARRIVALS <- [FLIGHT], PKB_arr ~ PKB, ELDT, SIBT;
read table myARR;
table myDEPout OUT "ODBC" "LIN\DEPqueryOutputProc.xls" # AMPL 32-bit, Excel 32-bit OK PER 64!!!!!
[NON_DROPPED,PARKING,ROUTE]
{d in NON_DROPPED, (r,k) in PATHr[d]:r=entryp[d]} tr[d,r,k] ~ TSAT_opt;
write table myDEPout;
table myDEPout2 OUT "ODBC" "LIN\DEPqueryOutputProc.xls" # AMPL 32-bit, Excel 32-bit OK PER 64!!!!!
[NON_DROPPED,RWY]
{d in NON_DROPPED, i in PATHi[d]: i='RWY'} ti[d,i] ~ TTOT_opt;
write table myDEPout2;table myDEPout OUT "tableproxy" "odbc" "LIN\prova.xls" 'verbose=1':
[NON_DROPPED,PARKING,ROUTE]
{d in NON_DROPPED, (r,k) in PATHr[d]:r=entryp[d]} tr[d,r,k] ~ TSAT_opt;
write table myDEPout;
table myDEPout2 INOUT "tableproxy" "odbc" "LIN\DEPqueryOutputProc.xls" 'verbose=1':
[NON_DROPPED,RWY]
{d in NON_DROPPED, i in PATHi[d]: i='RWY'} ti[d,i] ~ TTOT_opt;
write table myDEPout2;
Error at _cmdno 2235 executing "write_table" command
(file Linate_export_ACDM.run, line 18, offset 802):
Linate_export_ACDM.run, line 18 (offset 814):
Error writing table myDEPout with table handler tableproxy:
DROP TABLE `myDEPout` failed.
Is another application using "LIN\prova.xls"?
Verbose table-handler output:
AMPL ODBC driver, version 20151130.
Calling SQLDriverConnect("DRIVER=Driver do Microsoft Excel(*.xls);DBQ=C:\Users\Giovanni\Desktop\AMPL_GP\LIN\prova.xls")
Connection string: "DBQ=C:\Users\Giovanni\Desktop\AMPL_GP\LIN\prova.xls;Driver={Driver do Microsoft Excel(*.xls)};DriverId=790;MaxBufferSize=2048;PageTimeout=5;"
CREATE TABLE `myDEPout` (`NON_DROPPED` VARCHAR(9), `PARKING` VARCHAR(3), `ROUTE` VARCHAR(2), `TSAT_opt` NUMBER) returned -1
sqlstate = "42000"
errmsg = "[Microsoft][Driver ODBC Excel] Impossibile modificare la struttura della tabella "myDEPout". Il database è di sola lettura."
native_errno = -1809
DROP TABLE `myDEPout` returned -1
sqlstate = "S0002"
errmsg = "[Microsoft][Driver ODBC Excel] La tabella 'myDEPout' non esiste."
native_errno = -1305
context: write table >>> myDEPout; <<< table myDEP IN "tableproxy" "odbc" "LIN\DEPqueryOutputProc.xlsx": # AMPL 64-bit, Excel 32-bit
allDEPARTURES <- [FLIGHT], PKB_dep ~ PKB, EOBT, TOBT;
read table myDEP;
Error at _cmdno 3 executing "read_table" command
(file Linate_import_ACDM.run, line 18, offset 704):
Linate_import_ACDM.run, line 18 (offset 715):
Error reading table myDEP with table handler tableproxy:
No suitable driver found.
context: read table >>> myDEP; <<< Dear Bob, I have the very same problem. I already set the table name ( as you can see in the screenshot ), saved the file, and even typed the command "reset" in AMPLHowever, I get the following error while trying to read the table in AMPL using tableproxy:I tried to read the table in "amplide" environment. I'm using MS Excel 64-bit, and this is the version of AMPL I'm using:"option version 'AMPL Version 20200501 (MS VC++ 10.0, 64-bit; expires midnight 20201215 GMT)\option version 'AMPL Version 20200501 (MS VC++ 10.0, 64-bit; expires midnight 20201215 GMT)\"How can I fix this error? Thanks in advance.
El jueves, 1 de diciembre de 2016 a las 13:00:44 UTC-5, 4...@ampl.com escribió:
Highlight the entire range of cells in myfood.xls where your table appears (including the first row with the column names), then click the Name Box at the left end of the formula bar -- where B7 appears in this screenshot:
Este correo no representa opinión o consentimiento oficial de la Universidad del Norte, por lo que esta no adquiere ninguna responsabilidad por su contenido, salvo en el caso de funcionarios en ejercicio de atribuciones reglamentarias. Puede provenir de una cuenta ofrecida a funcionarios o estudiantes, como parte del ejercicio educativo, evento en el cual tanto el mensaje como sus anexos son estrictamente confidenciales. Ha sido analizado con software antivirus; no obstante, no se garantiza que sea seguro o no contenga errores o virus, por lo que la Universidad del Norte no se hace responsable de su transmisión. --
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 view this discussion on the web visit https://groups.google.com/d/msgid/ampl/9aa22a6c-30b4-4267-b1ef-90822fe28743n%40googlegroups.com.