<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>OGR join between shapefile and DBF</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">Hi List,</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I need to do a join between a shapefile and a DBF. I have checked my syntax thoroughly against </FONT><A HREF="http://www.remotesensing.org/gdal/ogr/ogr_sql.html"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://www.remotesensing.org/gdal/ogr/ogr_sql.html</FONT></U></A><FONT SIZE=2 FACE="Arial">, but I must be missing something simple&#8230;.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">My syntax is:</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&nbsp;CONNECTIONTYPE OGR</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;CONNECTION &quot;c:/data/allGP_MGA94.shp&quot;</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;DATA &quot;SELECT a.*,b.* FROM allGP_MGA94 a LEFT JOIN 'c:/data/descr.dbf' b ON a.CODE=b.CODE&quot;</FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Arial">I have tried with/without full path to DBF (since directory is the same as the shapefile). With/without station prefix, and many more variations. I keep getting this PHP error:</FONT></P>
<BR>

<P><FONT SIZE=2 FACE="Courier New">[20-Dec-2005 11:30:36] PHP Warning:&nbsp; [MapServer Error]: msOGRFileOpen(): ExecuteSQL(SELECT a.CODE,b.CODE FROM allGP_MGA94 a LEFT JOIN 'c:/data/descr.dbf' b ON a.CODE=b.CODE) failed.</FONT></P>

<P><FONT SIZE=2 FACE="Courier New">SELECT from table c:/data/descr.dbf failed, no such table/featureclass.</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&nbsp;in C:\chameleon\htdocs\common\wrapper\drawmap.php on line 560</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">But the file is there. Can anyone see anything obvious?</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Thanks in advance,</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Jacob</FONT>
</P>
<BR>
<BR>

<P><B><FONT COLOR="#009500" FACE="Arial">J</FONT><FONT COLOR="#009500" SIZE=1 FACE="Arial">ACOB</FONT> <FONT COLOR="#009500" FACE="Arial">D</FONT><FONT COLOR="#009500" SIZE=1 FACE="Arial">ELFOS<BR>
</FONT><FONT COLOR="#009500" FACE="Arial">GIS</FONT><FONT COLOR="#009500" SIZE=1 FACE="Arial"></FONT> <FONT COLOR="#009500" FACE="Arial">A</FONT><FONT COLOR="#009500" SIZE=1 FACE="Arial">NALYST</FONT><BR>
</B><FONT COLOR="#000000" SIZE=2 FACE="Arial">Maunsell Australia Pty Ltd<BR>
629 Newcastle Street, Leederville, WA 6007</FONT>

<BR><FONT COLOR="#000000" SIZE=2 FACE="Arial">PO Box 81, Leederville, WA 6902</FONT>

<BR><FONT COLOR="#000000" SIZE=2 FACE="Arial">Western Australia</FONT>

<BR><FONT COLOR="#000000" SIZE=2 FACE="Arial">ABN 20 093 846 925<BR>
<BR>
Tel     + 61 8 9281 6185<BR>
Fax    + 61 8 9281 6297<BR>
</FONT><U><FONT COLOR="#009C21" SIZE=2 FACE="Arial">jacob.delfos@maunsell.com</FONT></U>
</P>

</BODY>
</HTML>