Hi
      It depends how u r going to have ur attributes and object in ur VB
application.
Just in case u happen to use MapX, then using its UserDrawLayer/ Temporary
Layer , U can draw a layer on the control
and using the LayerInfo object U can then save the drawn layer as a full
fledged TAB File.
U can see more details of some codes at the www.mapx.com site under the
Discussion forum.

Here is a small snippet of saving a layer as a TAB file using MapX which
I'm reproduing from the MapX Discussion forum
Hope it helps u to some extent

Regards
Kaul, Deepak
Software Engineer
RMSI, NOIDA
INDIA

********************************************************************************************************************************************************************

When you use the Layers.CreateLayer method to create a layer it can include
a filespec clause or not. When you include the filespec, it creates a table
permanently. There isn't anyway to specify this afterwards. If you decide
you want to make this temporary layer permanent, you could create another
temporary layer but include the filespec so it creates it permanently.
Then, transfer the features from the temporary layer to the permanent
layer. In MapX 4.5 using LayerInfo, you can create a new MapInfo native
table taking a features collection and fields collection to create the new
table.

Cindy had this code in a previous posting, it shows the use of LayerInfo,
which is also explained in the Help files:

Below is a VB 6.0 code example. I add the layer and a temporary layer and
set the temporary layer as the insertion layer. I make the AddPointTool the
active tool and when the user clicks on the map, symbols are placed in the
temporary layer. Then, when the click the command button, the new symbols
that were added on the map and transferred to the layer.

Private Sub Command1_Click()
Dim ftrs As MapXLib.Features
Dim ftr As MapXLib.Feature
Set ftrs = Map1.Layers.Item("temp").AllFeatures
For Each ftr In ftrs
Map1.Layers.Item("cancaps").AddFeature ftr
Next
Map1.Layers.Remove ("temp")
End Sub

Private Sub Form_Load()
Dim LayerInfoObject As New LayerInfo
Dim lyr As Layer
Map1.Geoset = ""
Map1.Layers.Add "c:\program files\mapinfo mapx 4.0\maps\usa.tab"

'These would be altered to fit your data fields
LayerInfoObject.Type = miLayerInfoTypeServer
LayerInfoObject.AddParameter "name", "cancaps"
LayerInfoObject.AddParameter "ConnectString",
"SRVR=MARILYN;UID=CITY;PWD=CITY"
LayerInfoObject.AddParameter "Query", "select * from USA_CAPS"
LayerInfoObject.AddParameter "toolkit", "ORAINET"
LayerInfoObject.AddParameter "AutoCreateDataset", 1
LayerInfoObject.AddParameter "DatasetName", "Uscty"
Map1.Layers.Add LayerInfoObject

Set lyr = Map1.Layers.CreateLayer("temp")
lyr.Editable = True
Set Map1.Layers.InsertionLayer = lyr
Map1.CurrentTool = miAddPointTool
End Sub

*********************
If you know you want to save the Temp layer create it as a permanent layer,
but if it is optional, you would have to use the extra steps of recreating
it as a Permanent layer.

Bruce
MapInfo Technical Support
********************************************************************************************************************************************************************







_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to