473,569 Members | 2,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access and ESRI ArcView GIS

Anyone use il software ESRI ArcView GIS?????

In a DB Access I store information about plot of land, house and related
ownership.
By click a button in a specific record, I want to open ESRI ArcView with a
specific view: the selected object in access, is selected in the map in view

Who help me???

By Dany
Nov 13 '05 #1
3 6586
Danni

I recently did something similar but I am at this stage a bit of a
hacker (as in I'm not very good at it).

I do not need to open to arcmap and then zoom as I already have it
open when I go to a particular zoom.

But to open it with a map use something like this:

fullpath2 = "D:\Data\crash\ crash analysisBASIC.m xd"
Call ShellExecute(0, vbNullString, "D:\Data\crash\ crash
analysisBASIC.m xd", vbNullString, fullpath2, 1)
The most 'dodgy' thing about what I have done is that it uses
clipboard to paste a string from Access and then ArcMap grabs this
string and uses it as a query, then zooms to what it finds.

In access have a text box with your query made: ie "LandID = 5000"

Then have a button with an event:

'Incase the user makes another copy by accident this button recopies
the query
'string to clipboard

txtSelectObject sQuery.SetFocus

If IsNull(txtSelec tObjectsQuery) = False Then

DoCmd.RunComman d acCmdCopy

Else

MsgBox "There must be text in the query text box to copy", _
vbExclamation + vbOKOnly + vbDefaultButton 1, "No String
" & _
"to Copy!"

End If
Make a form in arcMap called frmQueryStringH older and save it to
normal.mxd
Now on a button you have created in ArcMap:

Private Sub FindIntersectio n_Click()

Dim str As String
frmQueryStringH older.txtSQLStr ing.SetFocus
frmQueryStringH older.txtSQLStr ing.Text = ""
frmQueryStringH older.txtSQLStr ing.Paste

'MsgBox frmQueryStringH older.txtSQLStr ing.Text
Call ThisDocument1.F indIntersection (frmQueryString Holder.txtSQLSt ring.Text)

End Sub
Now in a module named thisdocument1 put:

Option Explicit
Dim pMxApp As IMxApplication
Dim pMxDoc As IMxDocument
Private Declare Function sndPlaySound32 Lib "winmm.dll" Alias
"sndPlaySou ndA" (ByVal lpszSoundName As String, ByVal uFlags As Long)
As Long
Public Sub FindIntersectio n(strQuery As String)

On Error GoTo FindIntersectio nError:
Set pMxApp = Application
Set pMxDoc = ThisDocument

Dim pMap As IMap
Set pMap = pMxDoc.FocusMap
Dim pFLayer As IFeatureLayer
'Set pFlayer = pMap.Layers(0)
Dim i As Integer
For i = 0 To pMap.LayerCount - 1
If pMap.Layer(i).N ame = "IntersectL GA" Then
Set pFLayer = pMap.Layer(i)
End If
Next i

Dim pqfilter As IQueryFilter
Set pqfilter = New QueryFilter
pqfilter.WhereC lause = strQuery
Debug.Print pqfilter.WhereC lause

Dim pWS As IWorkspace
Dim pDS As IDataset
Set pDS = pFLayer.Feature Class
Set pWS = pDS.Workspace

'Dim pFselSet As ISelectionSet
'Set pFselSet = pFlayer.Feature Class.Select(pq filter,
esriSelectionTy peHybrid, esriSelectionOp tionNormal, pWS)
'Debug.Print pFselSet.Count

Dim pFSel As IFeatureSelecti on
Set pFSel = pFLayer
pFSel.SelectFea tures pqfilter, esriSelectionRe sultNew, False
Dim pSelSet As ISelectionSet
Set pSelSet = pFSel.Selection Set

Dim pEnvelope As IEnvelope
Dim pFcurs As IFeatureCursor
Dim pFeat As IFeature

If pSelSet.Count > 1 Then

Dim pEnumGeom As IEnumGeometry
Dim pEnumGeomBind As IEnumGeometryBi nd

Set pEnumGeom = New EnumFeatureGeom etry
Set pEnumGeomBind = pEnumGeom
pEnumGeomBind.B indGeometrySour ce Nothing, pSelSet

Dim pGeomFactory As IGeometryFactor y
Set pGeomFactory = New GeometryEnviron ment

Dim pGeom As IGeometry
Set pGeom = pGeomFactory.Cr eateGeometryFro mEnumerator(pEn umGeom)

pMxDoc.ActiveVi ew.Extent = pGeom.Envelope

ElseIf pSelSet.Count = 1 Then
pSelSet.Search Nothing, True, pFcurs
Set pFeat = pFcurs.NextFeat ure
Set pEnvelope = pFeat.Extent
Debug.Print pEnvelope.Width
pEnvelope.Width = pEnvelope.Width + 1
pEnvelope.Heigh t = pEnvelope.Heigh t + 1
pEnvelope.Expan d 50, 50, True
Debug.Print pEnvelope.Width
pMxDoc.ActiveVi ew.Extent = pEnvelope

Else
MsgBox "error"
End If

pMxDoc.ActiveVi ew.Refresh


'zoom out a little
Dim pActiveView As IActiveView
Dim pDisplayTransfo rm As IDisplayTransfo rmation

Dim pCenterPoint As IPoint

Set pActiveView = pMxDoc.FocusMap
Set pDisplayTransfo rm =
pActiveView.Scr eenDisplay.Disp layTransformati on
Set pEnvelope = pDisplayTransfo rm.VisibleBound s
'In this case, we could have set pEnvelope to IActiveView::Ex tent
'Set pEnvelope = pActiveView.Ext ent
Set pCenterPoint = New Point

pCenterPoint.X = ((pEnvelope.XMa x - pEnvelope.XMin) / 2) +
pEnvelope.XMin
pCenterPoint.Y = ((pEnvelope.YMa x - pEnvelope.YMin) / 2) +
pEnvelope.YMin
pEnvelope.Width = pEnvelope.Width * 1.1
pEnvelope.Heigh t = pEnvelope.Heigh t * 1.1
pEnvelope.Cente rAt pCenterPoint
pDisplayTransfo rm.VisibleBound s = pEnvelope
pActiveView.Ref resh
FindIntersectio nError:

If Err.Number = -2147467259 Then

MsgBox "The WHERE clause of the SQL statement comes from " & _
"clipboard. Please ensure the clipboard contains a valid " & _
"WHERE clause.", vbExclamation + vbOKOnly + _
vbDefaultButton 1, "SQL Error"
Exit Sub

Else

'MsgBox "Error Number " & Err.Number & " - " & Err.Description
End If
Call sndPlaySound32( "G:\RS&NM\RS\CR ASH\RequestsDB\ dogbark4.wav", 0)


End Sub

You'll have to change the code as usual to suit your needs. Most
importantly set the layer from "IntersectL GA" to what your layers name
is. This code combine's the geometries of objects if more than one
object is selected. It also for fun plays a dog barking sound file so
we know its found it - Corny hey.

Good luck. It may get you by

Lincoln King
Sydney, Australia


"danit58" <da*****@tiscal inet.it> wrote in message news:<cj******* ***@lacerta.tis calinet.it>...
Anyone use il software ESRI ArcView GIS?????

In a DB Access I store information about plot of land, house and related
ownership.
By click a button in a specific record, I want to open ESRI ArcView with a
specific view: the selected object in access, is selected in the map in view

Who help me???

By Dany

Nov 13 '05 #2
Hi Lincoln King

Thank for your Help

But the ESRI application that I must open is ArcView , not ArcMap.
The file extension is .ARP for the project and .SHP for the shape.

And My knowledge of this software is limited to use.

Can you give me more details?

Dany
Nov 13 '05 #3
Dany

Very sorry that was stupid of me - pays to read carefully!

I've got no good news for you as I have not implemented such a thing
in ArcView 3x - you have to code in Avenue for that.

It would work the same however so if you had any coding experience at
all you could give it a go in avenue.

Try looking on Esri.com under arcscripts - which i think is in the
downloads tab. There are heaps of scripts there.

"danit58" <da*****@tiscal inet.it> wrote in message news:<cj******* ***@lacerta.tis calinet.it>...
Hi Lincoln King

Thank for your Help

But the ESRI application that I must open is ArcView , not ArcMap.
The file extension is .ARP for the project and .SHP for the shape.

And My knowledge of this software is limited to use.

Can you give me more details?

Dany

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
23856
by: Nicola | last post by:
Hi Everyone, I am new to programming and would like to know how to open an access Report from within vb 6. I am trying to write a program to organise cross stitch threads. I have found out how to use a database table but all I want to do now is to click a command button to display this access report. Any suggestions please ?????
0
1606
by: Tim Churches | last post by:
The following notice about Geographic Info systems posts appeared in my in-box: > Research Associate - GIS and Health (2 Posts) Department of Geography, > University of Canterbury, New Zealand > http://www.geog.canterbury.ac.nz/vacant.shtml > The Department of Geography, University of Canterbury is looking to > appoint two GIS Research...
3
3028
by: PSD | last post by:
I am trying to link an access database directly to individual polygons or points (PGDB) in Arcmap, that is when opened the Access link would open Archmap and then zoom to the polygons or points individual coordinate assigned to that link. Thank you
1
3056
by: PSD | last post by:
Can anyone tell me how to open Microsoft Access db then use a individual link from the db to zoom to coordinates in Arcview 8.3 GIS(PGDB) Help PSD
5
2904
by: B1ackwater | last post by:
We've fooled around with Access a bit, but only using the single-user store-bought version. It seems to be a good database - versatile and infinitely programmable - and can apparently be used as a front end to SQL server if we ever needed to go that route. But - is there a client/server version of Access ? Looking on the CDW site there is...
6
6995
by: craig.buchinski | last post by:
Ok, i have a Access Database (which is used with my ESRI Arcmap) and i have written a query for a report to pull out our streetlights and group them by billing wattage. The problem is that it is counting the number of lights and summing them like i have asked, but in some cases there are more then one row with a different sum but the same...
1
2519
by: anbumozhip | last post by:
is there any code for color ramp available like the one which is present in arcview or arcgis
0
1005
by: geronimo.gpe | last post by:
Hello!!! somebody to used Maps of ArcView in Applications Web NET. The purpose is that these maps are actualizen of automatica way on the basis of the changes of the registries in the data base where resides the query. Some suggestion to make this process? I have not worked with Maps in Web, but I am in favor of incursionar in this ambito.
0
984
by: geronimo.gpe | last post by:
I need to show maps of arcview in a web application with visual Studio .net. The maps need to be actualized automatically if the Data Base is modified. We are using a SQL Database that is used to generate the maps. I don’t know how to do this, how to publish and how the maps can be actualized, some idea or some suggestion to do it? If anybody...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7678
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7982
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5222
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.