Hi LRB, I suggest you subscribe to help-glpk.
SQLite3 ODBC driver from www.ch-werner.de/sqliteodbc is working fine. I use it all the time. It is working with GLPK / MathProg iodbc and odbc. I suggest you look at the sql example (i.e. transp_odbc.mod) in the sql folder. SQL data and text data does not mix well in GMPL. Regards, Noli On 6/28/13, Andrew Makhorin <[email protected]> wrote: > -------- Forwarded Message -------- > From: technical forestry services <[email protected]> > To: [email protected] > 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 [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk
