Sanjay,
Here's some code for creating a bind layer using ODBC and returning the
layer and dataset as objects.
----------
'column 1 must be X-Longitude, column 2 must be Y-Latitude
strFields = "Longitude, Latitude, Title, ID"
arrFields = Split(strFields,",")
strLayerName = "BindLayer"
strConnect = "ODBC;UID=username;PWD=password;DLG=0"
strDataSource = "DatabaseName"
strSQL = "SELECT Longitude, Latitude, Title, ID FROM TableName"
'call the function
CreateBindLayer objCourier, objMap, strSQL, strConnect, strDataSource,
arrFields, strLayerName, objBindLayer, objDataSet
Function CreateBindlayer(_
ByVal objCourier,_
ByVal objMap,_
ByVal strSQL,_
ByVal strConnect,_
ByVal strDataSource,_
ByVal arrFields,_
ByVal strLayerName,_
ByRef objBindLayer,_
ByRef objDataSet)
'get data
Set objODBCQueryInfo = objCourier.CreateMapXODBCQueryInfo
objODBCQueryInfo.ConnectString = strConnect
objODBCQueryInfo.DataSource = strDataSource
objODBCQueryInfo.SqlQuery = strSQL
'create bindlayer
'column1 = Longitude, column2 = Latitude, BindLayer type is XY
Set objBindLayer = objCourier.CreateMapXBindLayer
objBindLayer.LayerName = strLayerName
objBindLayer.RefColumn1 = 1
objBindLayer.RefColumn2 = 2
objBindLayer.LayerType = miBindLayerTypeXY
'create a dataset for the bindlayer : dataset name same as bindlayer
Set objDataSet = objMap.Datasets.Add(2, objODBCQueryInfo, strLayerName, , ,
objBindLayer)
End Function
----------
You can find some good help on MapXtreme here:
http://www.mapxtreme.com/software/mapxtreme/nt/nt_support.html
Jeff Koncz
Directions Magazine
[EMAIL PROTECTED]
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of IDS
Sent: Friday, January 14, 2000 11:18 PM
To: [EMAIL PROTECTED]
Subject: MI MapXtreme Questions
Hello,
1. How can I make a query on my databse table and save this as
a new layer in Mapxtreme?
2. How can I select records from the master database table (access)
based on object (buffer select) in MapXtreme. I have been able
to create buffer and put the objects in a new predefined layer but
I am not able to get data columns together with the objects?
Thanks for any help on the above.
Regards
Sanjay
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]