Your post of Jan 15, 2007 on MapInfo-L about how to put a MapInfo map
and browser window into a dialog was an eye-opener, and although I don't
know how to embed an MI window into an Access form, I'd sure like to
know when you find out how to do this too! I get the feeling there's a
whole lot more that can be done with OLE than most of us have ever explored.
- Bill Thoen
Yes, I have done that in the past, with a mapinfo map window. In fact I think that several people have also described how it is done, on MI-L. It is just integrated mapping.
From the MS Access perspective: essentially, it is just the same as putting any OLE object onto an Access form. You need to place the container on the form, and then set the Access property accordingly to point to the particular object (MapInfo map).
Having said that, it’s not terribly flexible but in some situations it is quite OK.
Another way (until recent versions of Microsoft Access dumped the Data Access pages) was to “host” the maps externally, and link to them.
IL Thomas
GeoSciSoft - Perth,
Australia
From:
mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Nathan Woodrow
Sent: Friday, May 25, 2007 6:25 AM
To: mapi...@googlegroups.com
Subject: [MI-L] Mapinfo OLE and
Microsoft Access
Hi all,
Mike
Outlook 2003 calls an MDB (and about 50+ other files) a Type1 attachment and blocks it. You can ZIP the MDB (and it will be very much smaller, of course) and Access will let it pass.
IL Thomas
GeoSciSoft - Perth,
Australia
of this message and attachments. Thank you. <BR
Hi all,
I got MapInfo map working within an Access database very well (query/find objects, sync with other Access forms, manipulate tables etc.). If you are still interested, I can send you a code snippet, but since I am quite busy now, not earlier than next week.
Regards
Jaromir Svasta
State Geological Institute of Dionyz Stur
Mlynska dolina 1
817 04 Bratislava
Slovakia
Tel. +421-2-59375326
Fax. +421-2-54771940
From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Nathan Woodrow
Sent: Friday, May 25, 2007 12:25
AM
To: mapi...@googlegroups.com
I have a feeling that this could come in very handy, what we have is a
database and a mbx that is used to record all our water and sewer
maintenance around the shire. It uses the DDE method to communicate
with the access database, this works really well, just thought it
might be easier if I just had it all on one form rather then having to
deal with switching windows.
Thanks again everyone
Nathan Woodrow
GIS/Asset Support Officer
Warwick Shire Council
Ph: (07) 4661 0463
Email: NWoo...@Warwick.qld.gov.au
152° 2' 4.00812" -28° 12' 52.443864"
On May 26, 2:03 am, "Cummings, Mike"
<Mike.Cummi...@conservation.ca.gov> wrote:
> Didn't think about zipping it. I have attached a zipped copy.
>
>
>
> -----Original Message-----
> From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com]On Behalf Of SCISOFT
> Sent: Thursday, May 24, 2007 8:18 PM
> To: mapi...@googlegroups.com
> Subject: [MI-L] Re: Mapinfo OLE and Microsoft Access
>
> Mike
>
> Outlook 2003 calls an MDB (and about 50+ other files) a Type1 attachment and blocks it. You can ZIP the MDB (and it will be very much smaller, of course) and Access will let it pass.
>
> IL Thomas
> GeoSciSoft - Perth, Australia
>
> _____
>
> From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Cummings, Mike
> Sent: Friday, May 25, 2007 8:09 AM
> To: mapi...@googlegroups.com
> Subject: [MI-L] Re: Mapinfo OLE and Microsoft Access
>
> If I remember correctly this is what you all are looking for. I got it & never did anything with it. Just had other projects... If this MDB doesn't stay attached we will have to figure out another way to send it.
>
> -----Original Message-----
> From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com]On Behalf Of Ian Tidy
> Sent: Thursday, May 24, 2007 4:24 PM
> To: mapi...@googlegroups.com
> Subject: [MI-L] Re: Mapinfo OLE and Microsoft Access
>
> Nathan,
>
> This is an interesting idea. I haven't done this, but could you call MapInfo from VBA code inside Access? I don't know if VBA supports OLE calls, but I guess it would. From there you could control MapInfo from the VBA script.
>
> Just an untested thought.
>
> Cheers Ian
>
> _____
>
> From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Nathan Woodrow
> Sent: Friday, 25 May 2007 10:25 a.m.
> To: mapi...@googlegroups.com
> Subject: [MI-L] Mapinfo OLE and Microsoft Access
>
> Hi all,
>
> I was just wondering if anyone in this group has been able to show a Mapinfo map window inside a Access form and automated it with OLE.
>
> I have searched all over the net and have found forum posts saying that it can be done but no one really is saying how to do it.
>
> Thanks
>
> Nathan Woodrow
>
> GIS/Asset Support Officer *
>
> Warwick Shire Council
>
> Email: NWood...@Warwick.qld.gov.au
>
> 152° 2' 4.00812" -28° 12' 52.443864"
>
> _____
>
> This e-mail message has been scanned for Viruses and Content and cleared by MailMarshal
>
> _____
>
> _____
>
> This e-mail message has been scanned for Viruses and Content and cleared by MailMarshal
>
> _____
>
> ######################################################################
> Attention:
> This e-mail message and accompanying data may contain information that
> is confidential and subject to legal privilege. Any information
> provided is given in good faith. However unless specifically stated to
> the contrary, Napier City Council accepts no liability for the
> content of this e-mail or for the consequences of any action taken on
> the basis of the information provided, unless that information is
> subsequently confirmed in writing. If you are not the intended recipient,
> you are notified that any use, dissemination, distribution or copying
> of this message or data is prohibited. If you received this e-mail
> message in error, please notify us immediately and erase all copies
> of this message and attachments. Thank you. <BR
>
>
>
> ashmithing.zip
> 27KDownload- Hide quoted text -
>
> - Show quoted text -
I have just uploaded a picture to the files section of how I am using
Mapinfo OLE in access. It is still a work in progress but its getting
there.
Thanks
Nathan
On May 28, 9:10 am, Nathan Woodrow <Madman...@gmail.com> wrote:
> Thanks everyone for your help, muchly appreciated
>
> I have a feeling that this could come in very handy, what we have is a
> database and a mbx that is used to record all our water and sewer
> maintenance around the shire. It uses the DDE method to communicate
> with the access database, this works really well, just thought it
> might be easier if I just had it all on one form rather then having to
> deal with switching windows.
>
> Thanks again everyone
>
> Nathan Woodrow
> GIS/Asset Support Officer
> Warwick Shire Council
> Ph: (07) 4661 0463
> > - Show quoted text -- Hide quoted text -
Here is my solution to Mapinfo in Access database:
First add
Public MIObject As Object
Private wnd As Long
into the declarations section of some module. Then create a form, let’s name it MAPA with subform named MAPA_SUB, which will be the container of MapInfo OLE object.
Then add the folowing commands to the MAPA form (load sub procedure):
Private Sub Form_Load()
Set MIObject = CreateObject("Mapinfo.Application")
Call DrawMap
MIObject.DO "Set Application Window " & Me.hwnd
Set MICallBack = New Form_MAPA_SUB
MIObject.DO "Set Window Info Parent " & Me.hwnd
End Sub
And create the following sub procedure for drowing the map (in my case from your workspace, but can also be a single table):
Private Sub DrawMap()
MIObject.DO "Set Application Window " & Me.hwnd
MIObject.DO "Set Next Document Parent " & Form_MAPA.Controls!MapaCont.Form.hwnd & " Style 1"
MIObject.DO "Run Application """ & CurrentProject.Path & "\your_workspace.Wor"""
wnd = MIObject.Eval("FrontWindow()")
MIObject.DO "Set Window " & Str$(wnd) & " Min"
MIObject.DO "Set Window " & Str$(wnd) & " Max"
MIObject.DO "Set Window " & Str$(wnd) & " ScrollBars On"
End Sub
After some trial and error I realised, that to make map appear properly in the subform, it must be minimized and maximized subsequently. It is quite annoying, especially when resizing the form (see next example), but I don’t have better solution.
Private Sub Form_Resize()
If Me.WindowWidth < 8460 Or Me.WindowHeight < 2730 Then
DoCmd.CancelEvent
End If
Me.Controls!MapaCont.Width = Me.WindowWidth - (FormLastWWidth - Me.Controls!MapaCont.Width)
FormLastWWidth = Me.WindowWidth
Me.Controls!MapaCont.Height = Me.WindowHeight - (FormLastWHeight - Me.Controls!MapaCont.Height)
FormLastWHeight = Me.WindowHeight
MIObject.DO "Set Window " & Str$(wnd) & " Min"
MIObject.DO "Set Window " & Str$(wnd) & " Max"
End Sub
Then you are ready to add whatever MapBasic commands to add functionality to your map, see example of printing:
Private Sub PrintWinComm_Click()
MIObject.DO "PrintWin Window " & Str$(MIObject.Eval("FrontWindow()")) & " Interactive"
End Sub
I hope you will be successfull. If having any problems please ask.
Jaromir Svasta
State Geological Institute of Dionyz Stur
Mlynska dolina 1
817 04 Bratislava
Slovakia
Tel. +421-2-59375326
Fax. +421-2-54771940
From:
Jonathan Roberts [mailto:grem...@gmail.com]
Sent: Friday, May 25, 2007 2:34 PM
To: sva...@geology.sk
Subject: Fwd: [MI-L] Re: Mapinfo
OLE and Microsoft Access
Jaromir,
I am interested. Please send when you can. My e-mail is grem...@gmail.com (or just reply to this, of course).
Thank you in advance,
Jonathan
---------- Forwarded message ----------
From: Jaromir Svasta
<sva...@geology.sk>
Date: May 25, 2007 12:55 AM
Subject: [MI-L] Re: Mapinfo OLE and Microsoft Access
Hi all,
I got MapInfo map working within an Access database very well (query/find objects, sync with other Access forms, manipulate tables etc.). If you are still interested, I can send you a code snippet, but since I am quite busy now, not earlier than next week.
Regards
Jaromir Svasta
State Geological Institute of Dionyz Stur
Mlynska dolina 1
817 04 Bratislava
Slovakia
Tel. +421-2-59375326
Fax. +421-2-54771940
From: mapi...@googlegroups.com
[mailto:
mapi...@googlegroups.com] On Behalf Of Nathan
Woodrow
Sent: Friday, May 25, 2007 12:25
AM
To: mapi...@googlegroups.com
Subject: [MI-L] Mapinfo OLE and
Microsoft Access
Hi all,
I was just wondering if anyone in this group has been able to show a Mapinfo map window inside a Access form and automated it with OLE.
I have searched all over the net and have found forum posts saying that it can be done but no one really is saying how to do it.
Thanks
Nathan Woodrow
GIS/Asset Support Officer ý
Warwick Shire Council
Email: NWoo...@Warwick.qld.gov.au
152° 2' 4.00812" -28° 12' 52.443864"
Of course, I forgot one important part of the code in the Form_Open sub procedure of the MAPA_SUB:
Private Sub Form_Open(Cancel As Integer)
MIObject.SetCallback Me
End Sub
Regards,
Jaromir Svasta
State Geological Institute of Dionyz Stur
Mlynska dolina 1
817 04 Bratislava
Slovakia
Tel. +421-2-59375326
Fax. +421-2-54771940
From:
mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Jaromir Svasta
Sent: Monday, May 28, 2007 9:10 AM
To: 'Jonathan Roberts'; mapi...@googlegroups.com
Subject: [MI-L] Re: Mapinfo OLE
and Microsoft Access
Here is my solution to Mapinfo in Access database:
I have been trying to get the setcallback procedure working but for
some reason it always errors, there dson't seem to be anything that I
can do to make it work. Do you know what possibly might be wrong?
Thanks
On May 28, 5:18 pm, "Jaromir Svasta" <sva...@geology.sk> wrote:
> Of course, I forgot one important part of the code in the Form_Open sub
> procedure of the MAPA_SUB:
>
> Private Sub Form_Open(Cancel As Integer)
>
> MIObject.SetCallback Me
>
> End Sub
>
> Regards,
>
> Jaromir Svasta
> State Geological Institute of Dionyz Stur
> Mlynska dolina 1
> 817 04 Bratislava
> Slovakia
> Tel. +421-2-59375326
> Fax. +421-2-54771940
>
> _____
>
Jaromir Svasta
State Geological Institute of Dionyz Stur
Mlynska dolina 1
817 04 Bratislava
Slovakia
Tel. +421-2-59375326
Fax. +421-2-54771940