Check_Subject
Dear MI-L List The following syntax will change the working directory in Visual Basic:- ChDrive "C:\" ChDir "C:\MapInfo\Property\Forms\" I use the following to run an Oracle Form in an Int Map App. It works quite well but it doesn't pick up the "context files" which enables the relationships between forms but it has to be run in the correct working directory. mapinfo.do "run program """ & OrantHome & "bin\f50run32.exe C:\MapInfo\Property\Forms\A_MainM.fmx""" If anyone has any suggestions they would be appreciated Thanks Tim Chinchen (IT Services) mailto:[EMAIL PROTECTED] -- To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
RE: MI Integrating maps in a MS Access form
If you use VB you can use the same syntax in VBA:- On Error GoTo create_error Set mapinfo = GetObject(, "mapinfo.application") 'create OLE app to communicate with create_error: ' if you are here it means that the " GetObject call failed ' and so you will need to make a new instance using ' CreateObject Set mapinfo = CreateObject("mapinfo.application") mapinfo.do "close all" mapinfo.do "set next Document Parent " & mapwin.Hwnd & " Style 1" mapinfo.do "run application ""C:\winnt40\mapinfow.wor"" " mapinfo.do "Create Menu ""MapperShortCut"" As ""MapInfo in Access97"" " BUT! in VB I use an image window. This can't be used Access to support the .Hwnd function I've had to use the Threed OCX (Additional OCX) as MapWin Tim Chinchen (IT Services) mailto:[EMAIL PROTECTED] > -Original Message- > From: Leduc, Yannick [SMTP:[EMAIL PROTECTED]] > Sent: Friday, April 16, 1999 5:01 PM > To: 'MapInfo-L' > Subject: MI Integrating maps in a MS Access form > > Hi! > > Is it possible to integrate a MI interactive map in a MS Access form > ? If so, how it can be done. I'm very familiar with MI and MB, but not > very > with MS Access and VBA. > > I would like to be able to give two linear reference and then see the > portion of this road on a map. How can I do that ? Do you have some leads? > > > Thank you > > Yannick Leduc > Ministère des Transports > Direction de la Mauricie-Centre-du-Québec > Service des inventaires et du Plan > > tél.: (819) 371-6606 #331 > fax: (819) 371-6136 > email: [EMAIL PROTECTED] > > > -- > To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put > "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED] -- To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
RE: MI Re-post - Desperately seeking Help with MapInfo
Sharon, It is quite possible that ODBC support isn't installed. It is a real pain when supporting MapInfo because the installation of ODBC support is separate from the rest of the program. On the CD (MI5) MI5 program files are installed from:- ...\Install\MI_Pro ODBC support is installed from:- ...\install\ODBC If ODBC Support isn't installed then under >File the Open ODBC.. will be grayed out. _ If you have MI5, DAO - Direct Access to MS Access tables is now supported therefore you should be able to open directly a live access table. As far as OLE and DDE a good introduction is the use of OLE automation, Try the following in Access:- 1: Create a new database then a new form. 2: View design and then View>Code and under the Form_Load type (or cut and paste from here):- Private Sub Form_Load() On Error GoTo create_error Set mapinfo = GetObject(, "mapinfo.application") 'create OLE app to communicate with create_error: ' if you are here it means that the " GetObject call failed ' and so you will need to make a new instance using ' CreateObject Set mapinfo = CreateObject("mapinfo.application") What this does is produces an instance of MapInfo through OLE automation. If you are running NT - check out in the Task Manager - Processes and see if you have Mapinfow.exe listed 3: At the top of the code page type:- Dim mapinfo As Object 4: In form_load type the following - This loads the standard Mapinfow workspace stored in your Windows directory mapinfo.do "run application homedirectory$()+""\mapinfow.wor"" " Or Mapinfo.do "open Table ""World.tab"" interactive" 5: If you create a button on the from and right-click to build an event type the following:- Mapinfo.Visible = True In your task bar you should have MapInfo now showing, By maximising it and going to Close Table or new map window you may see if your tables are open. To hide MI5 you can use a button with Mapinfo.Visible = False. 6: The really clever stuff comes when using ODBC. Set up under control Panel an ODBC dataset:- Under system DSN - Set up a name for a DSN and navigate to an Access database with a table in. Name the DSN:- MapinfoData with a table called Table1 (Or adjust the following names) 7: Try the following syntax (either in the form load or on a button) qry = """select * from Table1""" dostmt = "Server Link Table " dostmt = dostmt & qry dostmt = dostmt & "Using ""DSN=MapInfoData"" into ""Table1"" " MapInfo.do dostmt This creates a MapBasic Command but executed through Access:- (Server Link Table Select * from Table1 Using "DSN=MapInfoData" into "Table1") 8: If you view MapInfo again (Using the Mapinfo.Visible = True or a button) you should be able to go to new browser window and view the Downloaded data. Using this approach you can edit the data in MI or in Access and you will always be looking at the same set of data. 9: This approach may seem quite strange with the MapInfo.Visible business but there exists ways of (WARNING GOOBLEDEEGOOK!) "Reparenting a Window using the Windows Hwnd" (this uses the following type of code if you have an image window or an OCX control that supports Hwnd):- MapInfo.do "set next Document Parent " & mapwin.Hwnd & " Style 1" (Where MapWin is the name of the image window or OCX) It is quite likely that you wouldn't have anything that supports this but give it a go any way! As Far as DDE goes check out the URL recommend recently:- http://testdrive.mapinfo.com/tdc/home.nsf/c3d4b43ae3050d7d8525647900631dd3/8 9cfd7b5219fb3b4852564880047191f?OpenDocument This will give you info as how to employ DDE in an Integrated Mapping environment, It will also explain general Integrated Mapping Concepts in more detal than here (but it mostly caters for those with VB or VisC++) As far as futher avenues of study see if you can find any information about OLE Db - A new concept that Microsft is promoting and should be supported by MI, but I have yet to use it. Any more problems, etc please do not hesitate to contact me. Tim Chinchen (IT Services) (01202) 454723 mailto:[EMAIL PROTECTED] > -Original Message- > From: Sharon Murray [SMTP:[EMAIL PROTECTED]] > Sent: Wednesday, May 26, 1999 10:55 PM > To: [EMAIL PROTECTED] > Subject: MI Re-post - Desperately seeking Help with MapInfo > > I'm re-posting this message, originally posted yesterday, as I don't think > it was sent successfully. Apologies if I'm wrong. > > Can anybody help me. I am a complete beginner with MapInfo, but I need to > know how to create a link between MapInfo and Access in each of the > following ways: ODBC connection, DDE link, OLE links. I need this for the > purposes of an academic assignment (no one is paying me to be so useless > !). > > All I want to do is to open an Access table in MapInfo and edit it, and > for > those changes I have made to be seen n Acc
RE: MI Integrated mapping data paths
By using the following, for example, instead of "Hard coding" file names mapinfo.do "open table """ & PREF1 & """ interactive" You may get around the problem. To set these variables I try one of two things 1 - Set settings in registry 2 - Write to an INI file which you can store in the "system root" 1/ Have a look in the VB help on SaveSettings and GetSettings 'To output information as part of a set preferences dialog SaveSetting "property", "Options", "OrantHome", Pref1.Text SaveSetting "property", "Options", "UserName", Pref2.Text SaveSetting "property", "Options", "UserBusinessUnit", Pref3.Text 'To input information to your app InPref1 = GetSetting("property", "Options", "OrantHome", "C:\Orant\") InPref2 = GetSetting("property", "Options", "UserName", "UserName") InPref3 = GetSetting("property", "Options", "UserBusinessUnit", "Business Unit") 2/ I have to admit I haven't used it in VB but in MB the Syntax would be as follows:- (VB and MB have generally the same approaches so the VB syntax won't be that much different but you may have to do an "API call" to find the system root) 'To output information as part of a set preferences dialog open File homedirectory$()+"\INIFILENAME.ini" for output as #1 Print #1, Pref1 Print #1, Pref2 Print #1, Pref3 Close File #1 End if 'To input information to your app if FileExists(homedirectory$()+"\INIFILENAME.ini") then open file homedirectory$()+"\INIFILENAME.ini" for input as #1 Line input #1, Pref1 Line input #1, Pref2 Line input #1, Pref3 close file #1 Tim Chinchen (IT Services) mailto:[EMAIL PROTECTED] Initial Question:- > I did an MI integrated mapping using Visual Basic. I specified a drive > name as in D: to look > for the MI tables. I using InstallShield 5.0 to create setup files for the > VB application. How do you give flexibility for users to install > on any drive they want and yet able to read the table files without hard > coding it in VB. > ** 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. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.bournemouth.gov.uk ** -- To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
RE: MI Zooming in to a selection
I haven't tested it but the following MapBasic Code should have the desired effect. Include "mapbasic.def" Include "icons.def" Declare sub Main Declare sub View_Selection Sub Main Create ButtonPad "View All" as PushButton HelpMsg "View Selection" Calling View_Selection Icon 203 end sub sub View_Selection onerror goto EndThisSub Select * from Selection into ViewLayer set map redraw off Add Map Layer ViewLayer Set map Zoom Entire Layer ViewLayer Remove Map Layer ViewLayer Interactive Set Map Redraw on EndThisSub: End Sub Tim Chinchen (GIS Systems Developer) I.T. Services Bournemouth Borough Council Mailto:[EMAIL PROTECTED] > -Original Message- > From: Dick Hoskins [SMTP:[EMAIL PROTECTED]] > Sent: Wednesday, December 01, 1999 12:17 PM > To: [EMAIL PROTECTED] > Subject: Re: MI Zooming in to a selection > > Summary concerning zooming to a selection: > > In MI itself QUERY>FIND SELCTION works but the result is sometimes not > too > useful. If you are at the wrong scale, indeed the selection will be found > but you might not see it. > > > Two mbx's I have been sent do much better. > > 1. Zoomselect puts an eye on the TOOLS floating menu bar. Once you have > made > a selection, choosing the eye will zoom in on the selection at a scale > that > will fit it (or all the selections) on the screen. Works very well. > > 2. Viewselection puts a menu item on the mapper menu, which can be seen > by > right clicking when the mapper is active and choosing "viewselection" The > result is the same as Zoomselect. > > I did not find these in the MI program archive. Perhaps the authors have > or > will submit them. > > Dick Hoskins > [EMAIL PROTECTED] > > -- > To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put > "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED] ** 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. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.bournemouth.gov.uk ** -- To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]