标签:driver conf xxx microsoft 驱动程序 base soft 配置 nal
Qgis3添加ERSI personal database(*.mdb)文件,出现:
ERROR 1: Unable to initialize ODBC connection to DSN for DRIVER=Microsoft Access Driver (*.mdb);DBQ=xxx.MDB, [Microsoft][ODBC 驱动程序管理器] 未发现数据源名称并且未指定默认驱动程序
原因:QGIS底层使用的GDAL库缺少配置项“PGEO_DRIVER_TEMPLATE”和“MDB_DRIVER_TEMPLATE”;
解决办法:
1、代码中添加:
CPLSetConfigOption("PGEO_DRIVER_TEMPLATE", "DRIVER=Microsoft Access Driver (*.mdb, *.accdb);DBQ=%s");
CPLSetConfigOption("MDB_DRIVER_TEMPLATE", "DRIVER=Microsoft Access Driver (*.mdb, *.accdb);DBQ=%s");
2、QGIS启动环境文件中添加
..
PGEO_DRIVER_TEMPLATE=DRIVER=Microsoft Access Driver (*.mdb, *.accdb);DBQ=%s
MDB_DRIVER_TEMPLATE=DRIVER=Microsoft Access Driver (*.mdb, *.accdb);DBQ=%s
..
标签:driver conf xxx microsoft 驱动程序 base soft 配置 nal
原文地址:https://www.cnblogs.com/PieDaoChuan/p/10177918.html