Title: Message
Hi,
 
Thanks David, I persisted with it, and put the join in with the map layer first.
After removing the alias of 'LP_map' and just working on the full map table name,
it worked !
 
thanks, nathan
 

---------------(\./)---------------
Nathan Carr
GIS Developer
LLPG/LSG Custodian & ALO
Swale Borough Council
Email  : [EMAIL PROTECTED]
Phone  : 01795 417 337
Mobile : 07957 461 685

-----Original Message-----
From: David Hilpipre [mailto:[EMAIL PROTECTED]
Sent: 30 August 2006 15:33
To: Nathan Carr; [email protected]
Subject: RE: [MI-L] Joining a SQL Server table of extra data to a map layer

Hello,
Might not help that much but I do that with MI maps joined to Interbase table (opened via ODBC) and it works fine. Just to tell you that it should definitely be working. I just can't see where it's going wrong.
- There should be some common fields between LP_map and LP_policies (like primary keys, a unique identifier in other word) to join the two tables.
- LP_map should be listed first in the "FROM" clause (Select * from LP_map, LP_policies where LP_map.someID = LP_Policies.someotherID) if you intend to use the result in some spatial queries later on. If LP_MAp is listed second, the result is only a table, without any map.
- again, if you intend to use the result in some spatial queries later on, the relation between the two table should be LP_Map 0-n --------> 0-1 LP_Policies (1 object on the map shouldn't be related to more than one record in LP_policies, otherwise, the resulting map is a bit akward to use, useless in most cases actually)
Apart from that...I don't know what to say...TRY HARDER ;-)
Regards
David HILPIPRE


De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Nathan Carr
Envoyé : mercredi 30 août 2006 13:24
À : [email protected]
Objet : [MI-L] Joining a SQL Server table of extra data to a map layer

Hello,
I'm trying to have a specific little MapBasic tool that will join my map layer
to a SQL server table of some additional data through ODBC.
I would then like to do a spatial query on an additional map layer, and extract
the extra data, if the spatial query is true.
I can seem to open the map layers and make the ODBC table linked in, but I
am not sure how to join the additional data to the map layer, to enable us to attempt
the spatial query.
So far all I've got is :
Sub Main
 Dim ODBC_handle As String
 include "mapbasic.def"
 
 Open Table "C:\Temp_Maps\LP_polygons.TAB" As LP_map
 
 Server Link Table "Select * From local_plans_policys" Using
  "DSN=LLC_planning_policy_lookup;UID=user;PWD=password"
  Into LP_policys File "C:\Temp\LP_policys"
 
 Map from LP_map
End Sub
I tried to add the join to the Link Table SQL, but MapInfo complained that LP_map wasn't
a table.
Do anyone have some code or help that can illustrate how to append extra data from SQL
server via ODBC to open map layer, which enable me then to run a spatial query on the map
layer and extract the added data columns.
Thanks Nathan
---------------(\./)---------------
Nathan Carr
GIS Developer
LLPG/LSG Custodian & ALO
Swale Borough Council
Email  : [EMAIL PROTECTED]
Phone  : 01795 417 337
Mobile : 07957 461 685


This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager at [EMAIL PROTECTED]

This message has been scanned for viruses by BlackSpider MailControl

I.T. Services
Swale Borough Council

Visit http://www.swale.gov.uk



Click here to report this email as spam.

_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to