[GRASS-user] Re: winGrass, ODBC and MS Access database

Dear GRASS user list,

tried to read a Microsoft Access database with GRASS 6.4.1 (installed with
QGIS 1.7.0) on a Windows XP system. Now I get an error message "odbc.exe"
when I try to use v.external, db.in.ogr or v.in.ogr. A data source name is
created with the MS ODBC administrator.

What I am wondering about is the error message. Searched for "odbc.exe" on
my system and did not find one. But there is a "odbcad32.exe" instead.

There seem to be some older attempts with ODBC connections to ORACLE. But as
I also could not find any hint, that anybody succeeded in using ODBC
database via OGR, I suspect now, that this is not possible.

Appreciate any comments or hints.
Thanks + Kind regards,
Christine

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Re-winGrass-ODBC-and-MS-Access-database-tp4356636p4356636.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Wed, Feb 1, 2012 at 4:41 PM, Christine <geo.guide@web.de> wrote:

Dear GRASS user list,

tried to read a Microsoft Access database with GRASS 6.4.1 (installed with
QGIS 1.7.0) on a Windows XP system. Now I get an error message "odbc.exe"
when I try to use v.external, db.in.ogr or v.in.ogr. A data source name is
created with the MS ODBC administrator.

What I am wondering about is the error message. Searched for "odbc.exe" on
my system and did not find one. But there is a "odbcad32.exe" instead.

Hi Christine,

I checked
http://trac.osgeo.org/grass/wiki/CompileOnWindows

and don't see any ODBC reference there. Nor I see it here
http://download.osgeo.org/osgeo4w/versions.html

Perhaps a wish request is needed at OSGeo4W?

There seem to be some older attempts with ODBC connections to ORACLE. But as
I also could not find any hint, that anybody succeeded in using ODBC
database via OGR, I suspect now, that this is not possible.

Generally yes,
http://grass.osgeo.org/wiki/Data_formats#ODBC
http://grass.osgeo.org/grass64/manuals/html64_user/grass-odbc.html

but you don't seem to have the ODBC driver compiled into
winGRASS yet...

Anyone having an idea?

Markus

FWIW, last year I tried to get winGrass, ODBC and Oracle to work (see here: http://lists.osgeo.org/pipermail/grass-user/2011-May/060662.html) with no success.

I too would be interested in any help on ODBC working in winGRASS.

Sharon

On Thu, Feb 2, 2012 at 8:33 AM, Markus Neteler <neteler@osgeo.org> wrote:

On Wed, Feb 1, 2012 at 4:41 PM, Christine <geo.guide@web.de> wrote:

Dear GRASS user list,

tried to read a Microsoft Access database with GRASS 6.4.1 (installed with
QGIS 1.7.0) on a Windows XP system. Now I get an error message “odbc.exe”
when I try to use v.external, db.in.ogr or v.in.ogr. A data source name is
created with the MS ODBC administrator.

What I am wondering about is the error message. Searched for “odbc.exe” on
my system and did not find one. But there is a “odbcad32.exe” instead.

Hi Christine,

I checked
http://trac.osgeo.org/grass/wiki/CompileOnWindows

and don’t see any ODBC reference there. Nor I see it here
http://download.osgeo.org/osgeo4w/versions.html

Perhaps a wish request is needed at OSGeo4W?

There seem to be some older attempts with ODBC connections to ORACLE. But as
I also could not find any hint, that anybody succeeded in using ODBC
database via OGR, I suspect now, that this is not possible.

Generally yes,
http://grass.osgeo.org/wiki/Data_formats#ODBC
http://grass.osgeo.org/grass64/manuals/html64_user/grass-odbc.html

but you don’t seem to have the ODBC driver compiled into
winGRASS yet…

Anyone having an idea?

Markus


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Dear Markus,

may I conclude, that access to Access databases (and ORACLE s.o.) is
available in unix distributions but seems to be missing currently in the
windows distributions ? So it could be worth trying with a virtual machine
on ubuntu e.g.

Beeing not familiar with compilation nor binding affairs or OSGeo4W
processes: I do not assume, that I can solve this by myself (I am not a
programmer). Where could I post a wish request and what should I propose
literally? - An ODBC reference and/or an ODBC driver compilation into
winGRASS ?

Regards, Christine

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Re-winGrass-ODBC-and-MS-Access-database-tp4356636p4358652.html
Sent from the Grass - Users mailing list archive at Nabble.com.

I checked
http://trac.osgeo.org/grass/wiki/CompileOnWindows

and don't see any ODBC reference there. Nor I see it here
http://download.osgeo.org/osgeo4w/versions.html

have a look at

http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/mswindows/osgeo4w/package.sh#L131

so osgeo4w-based wingrass should be configured with --with-odbc

Perhaps a wish request is needed at OSGeo4W?

There seem to be some older attempts with ODBC connections to ORACLE. But
as
I also could not find any hint, that anybody succeeded in using ODBC
database via OGR, I suspect now, that this is not possible.

Generally yes,
http://grass.osgeo.org/wiki/Data_formats#ODBC
http://grass.osgeo.org/grass64/manuals/html64_user/grass-odbc.html

but you don't seem to have the ODBC driver compiled into
winGRASS yet...

when I try to use v.external, db.in.ogr or v.in.ogr.

not tested yet if osgeo4w-gdal/ogr used by db.in.ogr or v.in.ogr is built
with obdc-support.

Helmut

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Re-winGrass-ODBC-and-MS-Access-database-tp4356636p4358688.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Beeing not familiar with compilation nor binding affairs or OSGeo4W

processes: I do not assume, that I can

solve this by myself (I am not a programmer). Where could I post a wish

request and what should I propose >literally? - An ODBC reference and/or an
ODBC driver compilation into winGRASS ?

just a quick look in a wingrass64svn-nightly build:

http://wingrass.fsv.cvut.cz/grass64/

C:\Program Files\GRASS 6.4.2svn\driver\db\odbc.exe

and also in osgeo4w-wingrass:

C:\OSGeo4W\apps\grass\grass-6.4.2RC3\driver\db\odbc.exe

so maybe a path issue?

Helmut

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Re-winGrass-ODBC-and-MS-Access-database-tp4356636p4358725.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Helmut wrote:

just a quick look in a wingrass64svn-nightly build:
http://wingrass.fsv.cvut.cz/grass64/

C:\Program Files\GRASS 6.4.2svn\driver\db\odbc.exe

what drivers are listed by 'db.drivers -p' ?

Hamish

C:\Program Files\GRASS 6.4.2svn\driver\db\odbc.exe

what drivers are listed by 'db.drivers -p' ?

(Thu Feb 02 12:32:49 2012)
db.drivers -p
dbf
dbf.manifest
odbc
odbc.manifest
ogr
ogr.manifest
pg
pg.manifest
sqlite
sqlite.manifest
(Thu Feb 02 12:32:50 2012) Befehl ausgeführt (0 sec)

Helmut

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Re-winGrass-ODBC-and-MS-Access-database-tp4356636p4358747.html
Sent from the Grass - Users mailing list archive at Nabble.com.

2012/2/2 Helmut Kudrnovsky <hellik@web.de>:

(Thu Feb 02 12:32:49 2012)
db.drivers -p
dbf
dbf.manifest
odbc
odbc.manifest
ogr
ogr.manifest
pg
pg.manifest
sqlite
sqlite.manifest
(Thu Feb 02 12:32:50 2012) Befehl ausgeführt (0 sec)

manifest files should be skipped, hopefully fixed in r50626.

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

manifest files should be skipped, hopefully fixed in r50626.

r50630 - grass/trunk/lib/db/dbmi_base
dbmi_base: skip manifest files when listing drivers
          (merge r50626 from relbr64)

AFAIK in wingrass7 the manifests are embedded in the exe and not an extra
file as in wingrass6

Helmut

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Re-winGrass-ODBC-and-MS-Access-database-tp4356636p4358852.html
Sent from the Grass - Users mailing list archive at Nabble.com.

tried to read a Microsoft Access database with GRASS 6.4.1 (installed with

QGIS 1.7.0) on a Windows XP

system. Now I get an error message "odbc.exe" when I try to use v.external,

db.in.ogr or v.in.ogr. A data

source name is created with the MS ODBC administrator.

is this access-database a personal geodatabase?

can you post the exact commands of v.external, db.in.ogr and v.in.ogr?

Helmut

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Re-winGrass-ODBC-and-MS-Access-database-tp4356636p4359849.html
Sent from the Grass - Users mailing list archive at Nabble.com.

The access-database is not a personal geodatabase. It contains point
coordinates and it is no problem to read and visualize the data with QGIS or
gvSIG. Meanwhile I found odbc.exe manually in the QGIS/GRASS installation
folder. Curious thing, that Windows Explorer search does'nt find it ...

1. Connect to database (works):
db.connect --verbose driver=odbc database=Testdatenbank

2. Attempts to import Data of the database with
v.external --verbose dsn=Testdatenbank output=Testdaten layer=GWM
db.in.ogr --verbose dsn=Testdatenbank db_table=MSSTAMM output=GWM key=OID
v.in.ogr --verbose dsn=Testdatenbank output=GWM

all fail. In all three cases a system error message occurs stating a problem
with odbc.exe and GRASS hangs. Python.exe also crashes or hangs.
Actually I am a newbie with GRASS GIS. Am I doing something wrong ?

Have saved error reports that should be send to Microsoft. Would that be
useful ?

Kind regards, Christine

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Re-winGrass-ODBC-and-MS-Access-database-tp4356636p4360354.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi,

2012/2/3 Christine <geo.guide@web.de>:

1. Connect to database (works):
db.connect --verbose driver=odbc database=Testdatenbank

It means that attribute data for newly created vector maps will be
stored in 'Testdatenbank' using `odbc` driver, nothing else. Geometry
will be stored in GRASS native format. Controlling external format for
output map can be done using `v.external.out` (GRASS 7 only).

2. Attempts to import Data of the database with
v.external --verbose dsn=Testdatenbank output=Testdaten layer=GWM
db.in.ogr --verbose dsn=Testdatenbank db_table=MSSTAMM output=GWM key=OID
v.in.ogr --verbose dsn=Testdatenbank output=GWM

all fail. In all three cases a system error message occurs stating a problem
with odbc.exe and GRASS hangs. Python.exe also crashes or hangs.

Could you report exact error? It's hard to guess.

Does

v.external -f

report ODBC format?

What

v.external dsn=Testdatenbank -l

says?

I have no experience with ODBC at all (from user POV), anyway [1] says
something about ODBC prefix. So I would assume

v.external dsn=ODBC:Testdatenbank -l

is right.

Martin

[1] http://gdal.org/ogr/drv_odbc.html

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

hi Martin,
tried it with the three versions for v.external. None of them worked:

(Sat Feb 04 21:24:43 2012)
*v.external -f *
Sorry, <f> is not a valid flag
ERROR: Required parameter <dsn> not set:
        (OGR datasource name. Examples:
                ESRI Shapefile: directory containing
shapefiles
                MapInfo File: directory containing mapinfo
files)
Description:
Creates a new vector as a read-only link to OGR layer.
Available drivers: ESRI Shapefile,MapInfo File,UK .NTF,SDTS
,TIGER,S57,DGN,VRT,REC,Memory,BNA,CSV,NAS,GML,GPX,KML,GeoJSO
N,Interlis 1,Interlis 2,GMT,SQLite,ODBC,PGeo,MSSQLSpatial,OG
DI,PostgreSQL,MySQL,PCIDSK,XPlane,AVCBin,AVCE00,DXF,Geoconce
pt,GeoRSS,GPSTrackMaker,VFK,PGDump,GPSBabel,SUA,OpenAir,PDS,
WFS,HTF,AeronavFAA
Keywords:
vector
Usage:
v.external dsn=string [output=name] [layer=string]
[--overwrite]
   [--verbose] [--quiet]
Flags:
--o Allow output files to overwrite existing files
--v Verbose module output
--q Quiet module output
Parameters:
     dsn OGR datasource name. Examples:
...
...
(Sat Feb 04 21:24:43 2012) Command finished (0 sec)
____________________________________________

(Sat Feb 04 21:25:36 2012)
*v.external dsn=Testdatenbank -l *
Sorry, <l> is not a valid flag
Description:
Creates a new vector as a read-only link to OGR layer.
Available drivers: ESRI Shapefile,MapInfo File,UK .NTF,SDTS
,TIGER,S57,DGN,VRT,REC,Memory,BNA,CSV,NAS,GML,GPX,KML,GeoJSO
N,Interlis 1,Interlis 2,GMT,SQLite,ODBC,PGeo,MSSQLSpatial,OG
DI,PostgreSQL,MySQL,PCIDSK,XPlane,AVCBin,AVCE00,DXF,Geoconce
pt,GeoRSS,GPSTrackMaker,VFK,PGDump,GPSBabel,SUA,OpenAir,PDS,
WFS,HTF,AeronavFAA
Keywords:
vector
Usage:
v.external dsn=string [output=name] [layer=string]
[--overwrite]
   [--verbose] [--quiet]
Flags:
--o Allow output files to overwrite existing files
--v Verbose module output
--q Quiet module output
Parameters:
     dsn OGR datasource name. Examples:
...
...
(Sat Feb 04 21:25:37 2012) Command finished (0 sec)
__________________________________________

(Sat Feb 04 21:27:11 2012)
*v.external dsn=ODBC:Testdatenbank -l*
Sorry, <l> is not a valid flag
Description:
Creates a new vector as a read-only link to OGR layer.
Available drivers: ESRI Shapefile,MapInfo File,UK .NTF,SDTS
,TIGER,S57,DGN,VRT,REC,Memory,BNA,CSV,NAS,GML,GPX,KML,GeoJSO
N,Interlis 1,Interlis 2,GMT,SQLite,ODBC,PGeo,MSSQLSpatial,OG
DI,PostgreSQL,MySQL,PCIDSK,XPlane,AVCBin,AVCE00,DXF,Geoconce
pt,GeoRSS,GPSTrackMaker,VFK,PGDump,GPSBabel,SUA,OpenAir,PDS,
WFS,HTF,AeronavFAA
Keywords:
vector
Usage:
v.external dsn=string [output=name] [layer=string]
[--overwrite]
   [--verbose] [--quiet]
Flags:
--o Allow output files to overwrite existing files
--v Verbose module output
--q Quiet module output
Parameters:
     dsn OGR datasource name. Examples:
                ESRI Shapefile: directory containing
shapefiles
                MapInfo File: directory containing mapinfo
...
...
(Sat Feb 04 21:27:12 2012) Command finished (0 sec)

regards, Christine

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Re-winGrass-ODBC-and-MS-Access-database-tp4356636p4365435.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hi,

2012/2/4 Christine <geo.guide@web.de>:

(Sat Feb 04 21:24:43 2012)
*v.external -f *

this flag is available only in GRASS7. In GRASS 6 you can get list of
supported OGR formats for reading using v.in.ogr

v.in.ogr -f

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

Hi,

2012/2/4 Christine <geo.guide@web.de>:

*v.external dsn=ODBC:Testdatenbank -l*
Sorry, <l> is not a valid flag

also here, this flag has v.external only in GRASS 7. In GRASS 6 try

v.in.ogr dsn=ODBC:Testdatenbank -l

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

Hi Martin,

"v.external -l" reports ODBC format:

Available OGR Drivers:
...
  ODBC (rw): ODBC
...
_______________________________

(Sun Feb 05 19:12:08 2012)
v.in.ogr dsn=ODBC:Testdatenbank -l

ERROR 1: Unable to initialize ODBC connection to DSN for
Testdatenbank,
[Microsoft][ODBC Microsoft Access Driver] Datenbank
'(unbekannt)' konnte nicht geöffnet werden. Entweder wird
die Datenbank nicht von Ihrer Anwendung erkannt, oder die
Datei ist beschädigt.
ERROR: Unable to open data source <ODBC:Testdatenbank>
(Sun Feb 05 19:12:09 2012) Command finished (0 sec)

[Sorry for german error reporting - though I have turned all settings to
English GRASS returns some comments in german:
[Microsoft][ODBC Microsoft Access Driver] Database
'(unknown)' could not be opended. Either database is not recognized by your
application, or file is damaged.]

Actually I can open this database "Testdatenbank" with QGIS and gvSIG and I
have no reason to assume data corruption. Have also connected to the
database with "db.connect --verbose driver=odbc database=Testdatenbank".

Do I miss anything ? First connecting, then calling the database somehow or
have I to undertake another step in between ?

thanks + regards, Christine

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Re-winGrass-ODBC-and-MS-Access-database-tp4356636p4367516.html
Sent from the Grass - Users mailing list archive at Nabble.com.