help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] [Fwd: GMPL table stmt]


From: Harley
Subject: Re: [Help-glpk] [Fwd: GMPL table stmt]
Date: Fri, 28 Jun 2013 11:42:28 +1000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130509 Thunderbird/17.0.6

The fix for this is a little tricky to do, so I thought that I would elaborate 
on Heinrich's diagnosis.

On a 64 bit Windows machine, if you use the Control Panel ODBC manager it will setup a 64 bit DSN to access that database. Unfortunately many applications, older versions of scripting languages and their libraries and drivers for databases are still implemented as 32 bit versions.

You need to create a 32 bit DSN for the database and to do this you must use the 32 bit ODBC manager usually located at:

  WINDOWS_DIR\SysWOW64\odbcad32.exe

I have had this problem SO many times with various applications and software that I create both 32 bit and 64 bit DSNs every time so everybody is happy.

Harley Mackenzie

PS. Robbie - should we add this to the wikibook somewhere as I am sure this 
will come up again!


On 28/06/13 11:11 AM, address@hidden wrote:
IM014:1:0:[Microsoft][ODBC Driver Manager] The specified DSN contains an

architecture mismatch between the Driver and Application
You are trying to use a 32bit DSN from a 64 bit executable or vice versa.

Make sure the bitness of the used components matches.

Best regards

Heinrich Schuchardt

http://www.xypron.de

Am 28.06.13 um 00:47 schrieb Andrew Makhorin

-------- Forwarded Message --------

From: technical forestry services <address@hidden>

To: address@hidden

Subject: GMPL table stmt

Date: Fri, 28 Jun 2013 10:06:35 +1200



Hello



I have been trying to get GMPL to read an SQLite3 database using the

following syntax.



set I ;

set J ;

set S dimen 2;



param c{i in I, j in J} ;

param d{i in I, j in J} ;



# table statement creates indexed parameters c[i, j] and d[i, j]

# and set S comprising (string) indices (i, j)

table tbl IN "iODBC"

'DSN=SQLite3 Datasource'

'SELECT id, srce, dest, dist, cost'

'FROM Ytij':

S <- [srce, dest], d~dist, c~cost ;



data ;

set I := Seattle San-Diego ;



set J := New-York Chicago Topeka ;

end ;



There seems to be an issue with the table statement in that the code

will compile OK

and by adding GMPL printf and display statements will correctly list the

database contents

during the compile phase.  However during any Build phase I get the

following error message:



Reading tbl...

Failed to connect



The driver reported the following diagnostics whilst running

SQLDriverConnect

IM014:1:0:[Microsoft][ODBC Driver Manager] The specified DSN contains an

architecture mismatch between the Driver and Application

Test_glpk_sqlite3.mod:27: error on opening table tbl

MathProg model processing error

Exit code: 1    Time: 0.228
I have tried a couple of SQLite-ODBC drivers without success:

1) sqliteodbc.exe available at www.ch-werner.de/sqliteodbc (installs

with (System) DSN=SQLite3 Datasource).

2)sqlite odbc driver as part of SQLite2009 Pro Enterprise Manager

(installs with (System) DSN=DSN_SQLite2010Pro).

SQLite2009 Pro Manager is available at

www.sqlite.org/cvstrac/wiki?p=ManagementTools   .



Changing the driver has no effect as the same error is reported during

the Build phase.



I attach the database that I attempted to read from.



If you can shed any light on the issue I would be extremely grateful.



If you require further information don't hesitate to make contact.



Would you please acknowledge receipt of this E-mail.



Regards



LRB



_______________________________________________

Help-glpk mailing list

address@hidden

https://lists.gnu.org/mailman/listinfo/help-glpk
_______________________________________________
Help-glpk mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-glpk

--
------------------------------------------------------------------
      Dr. Harley Mackenzie         ABN:   36 348 783 012

      HARD Software                Web:   www.hardsoftware.com
      PO BOX 8004                  Tel:   +61 3 5222 3435
      Newtown 3220, Australia      Email: address@hidden
------------------------------------------------------------------



reply via email to

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