qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.66k stars 3.01k forks source link

MDB files on QGIS 3.28.3 on OS X Ventura aren't recognized. #51966

Open drf5n opened 1 year ago

drf5n commented 1 year ago

What is the bug or the crash?

2023-02-21T15:51:43 CRITICAL Invalid Data Source : /Users/drf/Downloads/YC_AllShores_1937_2021.mdb is not a valid or recognized data source.

Steps to reproduce the issue

  1. Open a new project
  2. Go to Layer/AddLayer/AddVectorLayer,
  3. Choose an .mdb file
  4. Click Add
  5. See error on screen: Invalid Data Source: /Users/drf/Downloads/YC_AllShores_1937_2021.mdb is not a valid or recognized data source.

Versions

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

QGIS version | 3.28.3-Firenze | QGIS code revision | 9ae208a46d -- | -- | -- | -- Qt version | 5.15.2 Python version | 3.9.5 GDAL/OGR version | 3.3.2 PROJ version | 8.1.1 EPSG Registry database version | v10.028 (2021-07-07) GEOS version | 3.9.1-CAPI-1.14.2 SQLite version | 3.35.2 PDAL version | 2.3.0 PostgreSQL client version | unknown SpatiaLite version | 5.0.1 QWT version | 6.1.6 QScintilla2 version | 2.11.5 OS version | macOS 13.2   |   |   |   Active Python plugins FreehandRasterGeoreferencer | 0.8.3 QuickOSM | 2.1.1 profiletool | 4.2.2 quick_map_services | 0.19.33 DEMto3D | 3.51 LAStools | 1.4 GeoCoding | 2.18 latlontools | 3.6.8 crayfish | 3.6.0 processing | 2.12.99 sagaprovider | 2.12.99 grassprovider | 2.12.99 db_manager | 0.1.20 MetaSearch | 0.3.6 QGIS version 3.28.3-Firenze QGIS code revision [9ae208a46d](https://github.com/qgis/QGIS/commit/9ae208a46d) Qt version 5.15.2 Python version 3.9.5 GDAL/OGR version 3.3.2 PROJ version 8.1.1 EPSG Registry database version v10.028 (2021-07-07) GEOS version 3.9.1-CAPI-1.14.2 SQLite version 3.35.2 PDAL version 2.3.0 PostgreSQL client version unknown SpatiaLite version 5.0.1 QWT version 6.1.6 QScintilla2 version 2.11.5 OS version macOS 13.2 Active Python plugins FreehandRasterGeoreferencer 0.8.3 QuickOSM 2.1.1 profiletool 4.2.2 quick_map_services 0.19.33 DEMto3D 3.51 LAStools 1.4 GeoCoding 2.18 latlontools 3.6.8 crayfish 3.6.0 processing 2.12.99 sagaprovider 2.12.99 grassprovider 2.12.99 db_manager 0.1.20 MetaSearch 0.3.6 ### Supported QGIS version - [X] I'm running a supported QGIS version according to the roadmap. ### New profile - [X] I tried with a new QGIS profile ### Additional context Per https://github.com/qgis/QGIS/issues/27428 I tried the qgis's install of ogrinfo on the file with this output: ``` % /Applications/QGIS.app/Contents/MacOS/bin/ogrinfo ~/Downloads/YC_AllShores_1937_2021.mdb ERROR 1: Unable to initialize ODBC connection to DSN for /Users/drf/Downloads/YC_AllShores_1937_2021.mdb, ERROR 1: Unable to initialize ODBC connection to DSN for /Users/drf/Downloads/YC_AllShores_1937_2021.mdb, FAILURE: Unable to open datasource `/Users/drf/Downloads/YC_AllShores_1937_2021.mdb' with the following drivers. -> JP2ECW -> ESRIC -> PCIDSK -> netCDF -> PDS4 -> VICAR -> JP2OpenJPEG -> PDF -> MBTiles -> BAG -> EEDA -> OGCAPI -> ESRI Shapefile -> MapInfo File -> UK .NTF -> LVBAG -> OGR_SDTS -> S57 -> DGN -> OGR_VRT -> REC -> Memory -> CSV -> NAS -> GML -> GPX -> LIBKML -> KML -> GeoJSON -> GeoJSONSeq -> ESRIJSON -> TopoJSON -> Interlis 1 -> Interlis 2 -> OGR_GMT -> GPKG -> SQLite -> ODBC -> WAsP -> PGeo -> MSSQLSpatial -> PostgreSQL -> OpenFileGDB -> DXF -> CAD -> FlatGeobuf -> Geoconcept -> GeoRSS -> GPSTrackMaker -> VFK -> PGDUMP -> OSM -> GPSBabel -> OGR_PDS -> WFS -> OAPIF -> Geomedia -> EDIGEO -> SVG -> CouchDB -> Cloudant -> Idrisi -> ARCGEN -> XLS -> ODS -> XLSX -> Elasticsearch -> Walk -> Carto -> AmigoCloud -> SXF -> Selafin -> JML -> PLSCENES -> CSW -> VDV -> GMLAS -> MVT -> NGW -> MapML -> TIGER -> AVCBin -> AVCE00 -> HTTP ``` Using a homebrew installation of gdal on the same machine I got this output: ``` % /usr/local/bin/ogrinfo ~/Downloads/YC_AllShores_1937_2021.mdb ERROR 1: ODBC: MDB Tools driver not found! INFO: Open of `/Users/drf/Downloads/YC_AllShores_1937_2021.mdb' using driver `PGeo' successful. 1: Shorelines1937_thru_2021 (Multi Line String) 2: Transects1937_2021 (Multi Line String) ... [redacted] ```
drf5n commented 1 year ago

On a Mac, where would the gdal drivers be looking for the libraries and the ???/etc/odbcinst.ini files?

To get the Homebrew installation working, I needed /opt/homebrew/lib/odbc/libmdbodbc.dylib and an /opt/homebrew/etc/odbcinst.ini file like this:

[Microsoft Access Driver (*.mdb)]
Description = MDB Tools ODBC drivers
Driver = /opt/homebrew/lib/odbc/libmdbodbc.dylib
Setup = 
FileUsage = 1
UsageCount = 1

Maybe the Mac QGIS gdal install has odd path name expectations for the PGeo driver's ODBC needs?

danielraziel commented 6 months ago

It's a year later but my problem got fixed. I realized the folder path had some persian fonts in it. although the persian names weren't a problem for shapes, but for MDB files it seems they were.