[mapserver-users] OGR ODBC Layer with Password

Donald Kerr donald.kerr at dkerr.co.uk
Tue Dec 17 12:31:41 PST 2013


Ezmer,

Many thanks for the quick reply. There's no error, just a typo. I changed
the names of the DSN, and table just for the user group. The real map file
has the actual names which are correct i.e. no typos. 

Regards,

Donald


-----Original Message-----
From: Ezmer DeKleaner [mailto:ezmer.dekleaner at tlfhinc.com] 
Sent: 17 December 2013 20:27
To: Donald Kerr
Cc: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] OGR ODBC Layer with Password

Just looking at what you wrote... there is a difference


This is what you claim to have in your map file:
"CONNECTION "ODBC:Admin/MyPassword at MyDNSName,MyTableName" # Requires
GEOMETRY_COLUMNS table (SPATIAL_REF_SYS optional) - Fails if DATA included
in this map file

but when you past what you have by hand  (Note that the name in the ERROR
FILE IS MYDSNName...    DSN not DNS  I suspect a transliteration error....

On Dec 17, 2013, at 12:14 15PST, Donald Kerr <donald.kerr at dkerr.co.uk>
wrote:

> Any takers (see email below)? Help appreciated.
> 
> Regards,
> 
> Donald
> 
> -----Original Message-----
> From: Donald Kerr [mailto:donald.kerr at dkerr.co.uk]
> Sent: 12 December 2013 16:45
> To: 'Donald Kerr'
> Subject: OGR ODBC Layer with Password
> 
> Hi All,
> 
> I have a layer that uses OGR to connect to an Microsoft Access 
> database via ODBC.
> 
> CONNECTIONTYPE OGR
> CONNECTION "ODBC: MyDNSName,MyTableName" # Requires GEOMETRY_COLUMNS 
> table (SPATIAL_REF_SYS optional) - Fails if DATA included in this map 
> file
> 
> The above works on a database without password protection. When I add 
> a password to the database, I would expect to be able to connect using 
> the following line:
> 
> CONNECTION "ODBC:Admin/MyPassword at MyDNSName,MyTableName" # Requires 
> GEOMETRY_COLUMNS table (SPATIAL_REF_SYS optional) - Fails if DATA 
> included in this map file
> 
> But I get the following error in the log file:
> 
> [Thu Dec 12 16:22:35 2013].484000 msDrawMap(): WMS/WFS set-up and 
> query, 0.000s [Thu Dec 12 16:22:35 2013].484000 
> msOGRFileOpen(ODBC:Admin/MyPassword at MyDSNName,MyTableName)...
> [Thu Dec 12 16:22:35 2013].484000 
> OGROPen(ODBC:Admin/MyPassword at MyDSNName)
> [Thu Dec 12 16:22:35 2013].515000 msOGRFileOpen(): OGR error. Open 
> failed for OGR connection in layer `MyLayerName'.
> Unable to initialize ODBC connection to DSN for 
> Admin/MyPassword at MyDSNName, [Microsoft][ODBC Microsoft Access Driver] 
> Not a valid password
> 
> The only difference is the username and password being included in the 
> connection string.
> 
> If I run the following at the command line, all works well:
> 
> C:\ >ogrinfo ODBC:Admin/MyPassword at MyDSNName,MyTableName
> INFO: Open of `ODBC:Admin/MyPassword at MyDSNName,MyTableName'
>      using driver `ODBC' successful.
> 1: MyTableName
> 
> It would appear that the Username and Password are being ignored or 
> changed when used by MapServer since ogrinfo is working correctly and 
> opening the connection.
> 
> Any ideas?
> 
> Many thanks.
> 
> Regards,
> 
> Donald
> 
> 
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users



-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4259 / Virus Database: 3658/6928 - Release Date: 12/17/13





More information about the mapserver-users mailing list