help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue with reading from Excel


From: Meketon, Marc
Subject: Re: Issue with reading from Excel
Date: Tue, 10 Dec 2019 19:12:31 +0000

Has anyone been able to run the sudoku_excel.mod found on the examples\sql 
directory under windows 10 64bit?

Sent from my mobile

> On Dec 9, 2019, at 11:13 AM, Meketon, Marc via Users list for GLPK (GNU 
> Linear Programming Kit) <address@hidden> wrote:
>
> Forgot to CC the mailing list.
>
> -----Original Message-----
> From: Meketon, Marc
> Sent: Monday, December 9, 2019 11:04 AM
> To: Heinrich Schuchardt <address@hidden>
> Subject: RE: Issue with reading from Excel
>
> Thank you for your quick reply.
>
> I'm running on Windows 10, 64bit.  The message did not seem like it was a 
> driver issue.  The error says:  Syntax error in FROM clause
>
> I did not CD to the directory because I listed the full path 
> (dbq=C:\glpk_463\examples\sql\sudoku.xlsx)
>
> -----Original Message-----
> From: Heinrich Schuchardt <address@hidden>
> Sent: Monday, December 9, 2019 10:59 AM
> To: Meketon, Marc <address@hidden>; address@hidden
> Subject: Re: Issue with reading from Excel
>
> Hello Marc,
>
> which driver are you using?
>
> Your current directory is assumed to be examples\sql.
> Did you cd to that directory?
>
> Best regards
>
> Heinrich Schuchardt
>
> http://www.xypron.de
>
> Am 09.12.19 um 16:23 schrieb Meketon, Marc\ via \Users list for GLPK (GNU 
> Linear Programming Kit)
>
>> Hello GLPK’ers
>>
>> I’m trying to use GMPL to read from Excel.  Below is essentially from the 
>> Sudok_excel.mod example found in the distribution, but where I updated it 
>> with a later driver:
>>
>> set fields dimen 2;
>> param givens{1..9, 1..9}, integer, >= 0, <= 9, default 0;
>> /* the "givens" */
>>
>> table ti IN 'ODBC'
>>  'DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};'
>>  'dbq=C:\glpk_463\examples\sql\sudoku.xlsx'
>>  'SELECT ID, COL, LIN, VAL FROM [Sudoku$] '
>>  'WHERE ID = 1' :
>>  fields <- [COL, LIN], givens ~ VAL;
>>
>> end;
>>
>> ==>When I run this, two problems occur, and help would be appreciated:
>> ==>  1.  A window pops up asking me which Excel file to use.  Is there a way 
>> to eliminate it?
>> ==>  2.  I get the error below.  This is really important to solve.  I have 
>> tried both named ranges for the Excel data, and worksheet names (that end 
>> with a $).
>>
>> GLPSOL: GLPK LP/MIP Solver, v4.57
>> Parameter(s) specified in the command line:
>> --cover --clique --gomory --mir -m sudoku_excel.mod Reading model
>> section from sudoku_excel.mod...
>> 12 lines were read
>> Reading ti...
>> Connected to EXCEL 12.00.0000 - C:\glpk_463\examples\sql\sudoku.xlsx
>> SELECT COL, LIN, VAL FROM WHERE ID = 1
>> db_iodbc_open: Query
>> "SELECT COL, LIN, VAL FROM WHERE ID = 1"
>> failed.
>>
>> The driver reported the following diagnostics whilst running
>> SQLExecDirect 42000:1:-3506:[Microsoft][ODBC Excel Driver] Syntax error in 
>> FROM clause.
>> sudoku_excel.mod:5: error on opening table ti MathProg model
>> processing error
>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]