<DIV>
<DIV>Yesss!</DIV>
<DIV>&nbsp;</DIV>
<DIV>It works!</DIV>
<DIV>&nbsp;</DIV>
<DIV>I just set up the user and password as you suggested: 'ODBC:userid/password@prova'</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thank you very much Frank&nbsp;for this precious help!</DIV>
<DIV>&nbsp;</DIV>
<DIV>joao</DIV>
<DIV><BR><BR><B><I>Frank Warmerdam &lt;fwarmerdam@GMAIL.COM&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">On Wed, 9 Feb 2005 10:57:16 +0000, jo˙ffffffffffe3o Antunes<BR><BLUETUNA_GOES_SKYING@YAHOO.CO.UK>wrote:<BR>&gt; This example works perfectly with an ODBC for an Access Database. I instaled<BR>&gt; and configured ODBC for my SQL, but still it does not work. I get this<BR>&gt; message: <BR>&gt; <BR>&gt; Warning: [MapServer Error]: msDrawMap(): Failed to draw layer named<BR>&gt; 'comuni'. in c:\programmi\apache group\apache\htdocs\abruzzo\_test_odbc.php<BR>&gt; on line 6<BR>&gt; <BR>&gt; Warning: [MapServer Error]: msOGRFileOpen(): ExecuteSQL(SELECT * FROM<BR>&gt; comuni_abruzzo_gb LEFT JOIN 'ODBC:prova'.zzz ON comuni_abruzzo_gb.Id =<BR>&gt; zzz.ID) failed. Unable to initialize ODBC connection to DSN prova,<BR>&gt; [MySQL][ODBC 3.51 Driver]Access denied for user 'ODBC'@'localhost' (using<BR>&gt; password: NO) in c:\programmi\apache<BR>&gt; group\apache\htdocs\abruzzo\_test_odbc.php on
 line 6<BR><BR>Joao,<BR><BR>The problem in the OGR based approach is that the ODBC<BR>connection is failing. The truth is that I don't know that <BR>much about the internals of ODBC and how system and user<BR>DSNs work. But basically the OGR code just uses the DSN<BR>name to try and open the ODBC connection and if it isn't<BR>setup properly in advance you will crash and burn - as you<BR>have.<BR><BR>My understanding is that you need to use a System DSN,<BR>not a user dsn and that there may be permissions issues that<BR>apply to the user that cgi's are run under. <BR><BR>If you are interested in narrow down the issue, try:<BR><BR>o Using "ogrinfo.exe -ro 'ODBC:prova' -al -so" and see if<BR>you are able to connect. This is the first level verification<BR>of ODBC under OGR and if this works but the cgi use<BR>does not then you have a permissions error. If this does<BR>not work then you likely have a DSN issue. <BR><BR>o Try "shp2img.exe -m <YOURMAPFILE>-o out.png" to see<BR>if the layer
 definition is renderable. This will test the<BR>join and other configuration while not suffering<BR>from permissions issues. <BR><BR>Note, I have not had much success specifying my userid<BR>and password as part of the DSN. I have generally had to<BR>fallback on specifying them in the OGR connection string.<BR>Something like 'ODBC:userid/password@prova'.<BR><BR>Good luck,<BR>-- <BR>---------------------------------------+--------------------------------------<BR>I set the clouds in motion - turn up | Frank Warmerdam, warmerdam@pobox.com<BR>light and sound - activate the windows | http://pobox.com/~warmerdam<BR>and watch the world go round - Rush | Geospatial Programmer for Rent<BR></BLOCKQUOTE></DIV><p>
                <hr size=1> <font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="http://uk.rd.yahoo.com/mail/taglines/default/messenger/*http://uk.messenger.yahoo.com"><strong><font face="Arial, Helvetica, sans-serif">ALL-NEW
Yahoo! Messenger</font></strong></a><font face="Arial, Helvetica, sans-serif"><strong>
- all new features - even more fun!</strong></font><strong><font color="#FF9900">
</font></strong></font>