Re: Issue with reading from Excel

"Meketon, Marc" via "Users list for GLPK \(GNU Linear Programming Kit\)" <[email protected]>
Newsgroups gmane.comp.gnu.glpk
Message-ID <[email protected]>
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) <[email protected]> wrote:
>
> Forgot to CC the mailing list.
>
> -----Original Message-----
> From: Meketon, Marc
> Sent: Monday, December 9, 2019 11:04 AM
> To: Heinrich Schuchardt <[email protected]>
> 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 <[email protected]>
> Sent: Monday, December 9, 2019 10:59 AM
> To: Meketon, Marc <[email protected]>; [email protected]
> 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
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.