<DIV>Dear list partners,</DIV>
<DIV> </DIV>
<DIV>In the last few days I have been trying to link my map file to a table in a MySQL database.</DIV>
<DIV>I must say I haven't had much success finding documentation on how to do this...</DIV>
<DIV>So I would like to ask for some help.</DIV>
<DIV> </DIV>
<DIV>So far, the map files I used are:</DIV>
<DIV> </DIV>
<DIV> LAYER<BR> NAME comuni<BR> TYPE POLYGON<BR> STATUS DEFAULT<BR> LABELITEM 'Nomecomune'</DIV>
<DIV> CONNECTIONTYPE OGR<BR> CONNECTION "C:\Programmi\Apache Group\Apache\htdocs\abruzzo\maps\data\comuni_abruzzo_gb.shp"<BR> DATA "SELECT * FROM comuni_abruzzo_gb LEFT JOIN 'ODBC:prova'.zzz ON comuni_abruzzo_gb.Id = zzz.ID"<BR> <BR> CLASSITEM FIELD<BR> CLASS<BR> NAME '<3'<BR> EXPRESSION ([FIELD] < (3))<BR> STYLE<BR> OUTLINECOLOR 255 255 255<BR> COLOR 215 050 085<BR> END<BR> TEMPLATE void<BR> END<BR> CLASS<BR> NAME '<6'<BR> EXPRESSION ([FIELD] < (6))<BR>
STYLE<BR> OUTLINECOLOR 255 255 255<BR> COLOR 215 150 085<BR> END<BR> TEMPLATE void<BR> END<BR> CLASS<BR> NAME '<10'<BR> EXPRESSION ([FIELD] < (10))<BR> STYLE<BR> OUTLINECOLOR 255 255 255<BR> COLOR 215 250 085<BR> END<BR> TEMPLATE void<BR> END</DIV>
<DIV><BR> END<BR></DIV>
<DIV>FIELD is the field according to witch values I want to make my thematic map. These values will change allong the time.</DIV>
<DIV>This example works perfectly with an ODBC for an Access Database. I instaled and configured ODBC for my SQL, but still it does not work. I get this message:</DIV>
<DIV> </DIV>
<DIV><STRONG>Warning</STRONG>: [MapServer Error]: msDrawMap(): Failed to draw layer named 'comuni'. in <B>c:\programmi\apache group\apache\htdocs\abruzzo\_test_odbc.php</B> on line <B>6</B><BR><BR><B>Warning</B>: [MapServer Error]: msOGRFileOpen(): ExecuteSQL(SELECT * FROM comuni_abruzzo_gb LEFT JOIN 'ODBC:prova'.zzz ON comuni_abruzzo_gb.Id = zzz.ID) failed. Unable to initialize ODBC connection to DSN prova, [MySQL][ODBC 3.51 Driver]Access denied for user 'ODBC'@'localhost' (using password: NO) in <B>c:\programmi\apache group\apache\htdocs\abruzzo\_test_odbc.php</B> on line <B>6</B><BR><BR><B>Fatal error</B>: Call to a member function on a non-object in <B>c:\programmi\apache group\apache\htdocs\abruzzo\_test_odbc.php</B> on line <B>7</B><BR></DIV>
<DIV>As if my configuration for the ODBC MySQL was ignored.. Within this configuration I am using a valuable mysql user and an existent password. Here i get a message as if I was trying to get into the system with no settings, user and pass by default.</DIV>
<DIV> </DIV>
<DIV>Anyway, I also tried to make this connection this way:</DIV>
<DIV> </DIV>
<DIV> LAYER<BR> NAME comuni<BR> DATA comuni_abruzzo_gb<BR> TYPE POLYGON<BR> STATUS DEFAULT<BR> LABELITEM 'Nomecomune'<BR> JOIN<BR> CONNECTIONTYPE mysql<BR> CONNECTION "server:'localhost' user:'tuna' pass:'caparica' database:'abruzzo'"<BR># DATA "SELECT * FROM comuni_abruzzo_gb LEFT JOIN 'ODBC:abr_2'.zzz ON comuni_abruzzo_gb.Id = zzz.ID"<BR> NAME "TM"<BR> TABLE zzz<BR> FROM Id<BR> TO ID<BR> TYPE SINGLE<BR> END<BR> CLASSITEM FIELD<BR> CLASS<BR> NAME '<3'<BR> EXPRESSION ([FIELD] < (3))<BR> STYLE<BR>
OUTLINECOLOR 255 255 255<BR> COLOR 215 050 085<BR> END<BR> TEMPLATE void<BR></DIV>
<DIV>But again, this does not work.. This time I get this message:</DIV>
<DIV> </DIV>
<DIV><BR><B>Warning</B>: [MapServer Error]: msDrawMap(): Failed to draw layer named 'comuni'. in <B>c:\programmi\apache group\apache\htdocs\abruzzo\_test_odbc.php</B> on line <B>6</B><BR><BR><B>Warning</B>: [MapServer Error]: msDBFGetItemIndex(): Item 'FIELD' not found. in <B>c:\programmi\apache group\apache\htdocs\abruzzo\_test_odbc.php</B> on line <B>6</B><BR><BR><B>Fatal error</B>: Call to a member function on a non-object in <B>c:\programmi\apache group\apache\htdocs\abruzzo\_test_odbc.php</B> on line <B>7</B></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV>Can someone give me a hand with this?</DIV>
<DIV>I' ve been searching for documentation and/or examples in the net but so far I just cannot have clear ideas about how to use/what's the sintax of some of the elements of the map file..</DIV>
<DIV> </DIV>
<DIV>Thanks a lot in advance.</DIV>
<DIV> </DIV>
<DIV>Joao Antunes</DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV> </DIV>
<DIV> </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>