did you try if the connection via pure PHP/PEAR to your ODBC connection 
is working correctly? And try best via a Web page, not just a command 
line run of the PHP script. Like

$dsn = "odbc://'':''/localhost at daticatastali";
$dbh = DB::connect($dsn);
if (DB::isError($dbh)) {
      die ($dbh->getMessage());
}

That is the first step to check, since pmapper does not have lots of 
debugging to work with databases and joins. In your case it looks like a 
not correctly set definition of the connection parameters. It stems from 
the call

$dbh = $this->dbConnect($dsn);
if (!$dbh) error_log ...

A DSN file is not required and I don't know what it should contain. As 
long as you have not set a password, user and password string remain 
empty ('').

I have not used joins since some time, but 1-to-1 should work (1-to-many 
will not work corrcetly).

I have an old definition that is

"odbc://'':''/myserver at peartest||corine at [EMAIL PROTECTED] at 
landcover||CODE||0"

where 'peartest' is the ODBC definition ('Data Source Name') defined in 
Windows ODBC Admin (I think it has to be a *SYSTEM* DSN). 'corine' is a 
table in the mdb file. 'code' is the join field in the ODBC table, 
'CODE' the join field in the shapefile dbf.

armin

toni wrote:
> Hello everybody,
> i'm in troubles and i hope you can help me.
> 
> I'm a beginner in pmapper and i have to solve a problem with a join to an
> external ms-access database: join doesn't work, more over are the
> explanations.
> I've read the whole newsletter but usually talks about problems with
> postgres and there are no useful examples for me. Even PEAR manual is too
> short.
> 
> My machine (os: win xp) runs Mapserver for Windows (MS4W) v. 1.5.0 (the
> package as is) and I've installed pmapper v.1.2.0 following the instructions
> in the documentation
> 
> ------------------------------
> This is the layer interested in the join (map file extract):
> 
> # Start of Layer fabbricati
> #
> LAYER
>   NAME "fabbricatiGBO"
>   TYPE polygon
>   DATA "fabbricatiGBO"
>   METADATA
>     "DESCRIPTION" "fabbricati"
>     "RESULT_FIELDS" "IDF,FABBRI_N,FABBRI_T,FOGLIO_N,FOGLIO_T,ID1"
>     "RESULT_HEADERS" "Idf,Fabbri_n,Fabbri_t,Foglio_n,Foglio_t,Id1"
>     "RESULT_JOIN"
> "odbc://'':''/localhost at daticatastali||SITUAZIF at [EMAIL PROTECTED] at 
> Cons||IDF||1"
>   END  # Metadata
>   CLASS
>     Name 'fabbricati'
>     COLOR 252 205 104
>     OUTLINECOLOR 0 0 0
>     TEMPLATE void
>   END  # Class
> END  # Layer
> 
> ------------------------------
> Here is the error in the error log file:
> 
> [27-Apr-2006 18:05:15] Could not connect to DB defined for Layer
> 'fabbricatiGBO'. Check map file entry for JOIN definition.
> 
> ------------------------------
> What i did:
> 
> I created a DSN file named 'daticatastali.dsn' pointing to the ms-access
> database, but i don't know where to put it and if it has the right content.
> Then I even created a user DSN.
> I checked if PEAR's DB module was installed and i found it in
> c:\ms4w\Apache\php\PEAR\DB
> I tried to change the syntax in many ways but unsuccessfully.
> I controlled that filed names were right.
> 
> ------------------------------
> My questions:
> 
> What's the right syntax for the "RESULT_JOIN" instruction?
> Am I in the correct way?
> Where i put the dsn file?
> Do I have to use username 'admin' or change slashes or paths?
> 
> 
> Thanks in advance
> Greetings, antonio
> 
> 
> _______________________________________________
> Pmapper-users mailing list
> Pmapper-users at faunalia.it
> http://faunalia.it/cgi-bin/mailman/listinfo/pmapper-users
> 
> 

Reply via email to