[GRASSLIST:9610] Re: Using unixODBC to connect GRASS to MySQL [Mac] - please test iODBC anyone

William Kyngesburye woklist at kyngchaos.com
Thu Dec 22 10:34:35 EST 2005


(I bumping this back to the list, Nick)

On Dec 22, 2005, at 1:28 AM, Nick Cahill wrote:

> Dear William,
>
> Sorry, it's been a very hectic couple weeks and I had to put off  
> testing GRASS and Filemaker.

I hear you.

> I just made a stab at it - installing the ODBC driver and such. I  
> have FMP 7 and the driver, and hope they're configured correctly.  
> However, when I run your GRASS, I get an error:
>
>
> channel "console1" wasn't opened for writing
> channel "console1" wasn't opened for writing
>     while executing
> "error $fh"
>     (procedure "run_cmd" line 24)
>     invoked from within
> "run_cmd 2"
>     invoked from within
> ".dialog1.run invoke"
>     ("uplevel" body line 1)
>     invoked from within
> "uplevel #0 [list $w invoke]"
>     (procedure "tk::ButtonUp" line 23)
>     invoked from within
> "tk::ButtonUp .dialog1.run"
>     (command bound to event)
>
>
> so I can't run any GUI commands.
>
Is that right when you run grass in GUI mode?  ie grass61 -gui.  Oh,  
your tcl/wish settings might be looking at a different Tcl/Tk.  Try  
setting this in your .bash_profile:

export GRASS_TCLSH=/usr/local/grasslibsx/bin/tclsh8.4
export GRASS_WISH=/usr/local/grasslibsx/bin/wish8.4

(or use setenv in .cshrc for the tcsh)

>
> So I tried it from the command line. I had set up a FMPro database  
> called ODBCTest, shared it from within FM, but I don't have the  
> ODBC Admin program that lets me test whether the connection is  
> actually set up - so there may be a problem there. .In any case I got:
>
>
> GRASS 6.1.cvs (sardis):/usr/local/bin > db.connect driver=odbc  
> database=ODBCTest
> GRASS 6.1.cvs (sardis):/usr/local/bin > db.test test=test1
> create table grass_test1 (i1 integer, d1 double precision, c1  
> varchar(20))
> DBMI-ODBC driver error: SQLConnect():
> [iODBC][Driver Manager]Data source name not found and no default  
> driver specified. Driver could not be loaded (0)
>
> ...
>
I think this is where the DSN comes in.  As it says, iODBC doesn't  
have a DSN defined for the database you specified.  The DSN ties a  
specific database name (what you use in db.connect) to an ODBC driver  
and source database.  The GRASS docs for the db commands don't say  
much on this (maybe somewhere there is more info), but the GDAL docs  
on ODBC connections helped me to understand this.  How you setup the  
DSN (parameters and such) is still hazy, all I know is you use ODBC  
Administrator.

Someone on the list might know more about ODBC.  I hope we can get  
this working ^_^


-----
William Kyngesburye <kyngchaos at kyngchaos.com>
http://www.kyngchaos.com/

Earth: "Mostly harmless"

- revised entry in the HitchHiker's Guide to the Galaxy




More information about the grass-user mailing list