473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 6570
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.mxd"
Call ShellExecute(0, vbNullString, "D:\Data\crash\crash
analysisBASIC.mxd", 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

txtSelectObjectsQuery.SetFocus

If IsNull(txtSelectObjectsQuery) = False Then

DoCmd.RunCommand acCmdCopy

Else

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

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

Private Sub FindIntersection_Click()

Dim str As String
frmQueryStringHolder.txtSQLString.SetFocus
frmQueryStringHolder.txtSQLString.Text = ""
frmQueryStringHolder.txtSQLString.Paste

'MsgBox frmQueryStringHolder.txtSQLString.Text
Call ThisDocument1.FindIntersection(frmQueryStringHolde r.txtSQLString.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
"sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long)
As Long
Public Sub FindIntersection(strQuery As String)

On Error GoTo FindIntersectionError:
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).Name = "IntersectLGA" Then
Set pFLayer = pMap.Layer(i)
End If
Next i

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

Dim pWS As IWorkspace
Dim pDS As IDataset
Set pDS = pFLayer.FeatureClass
Set pWS = pDS.Workspace

'Dim pFselSet As ISelectionSet
'Set pFselSet = pFlayer.FeatureClass.Select(pqfilter,
esriSelectionTypeHybrid, esriSelectionOptionNormal, pWS)
'Debug.Print pFselSet.Count

Dim pFSel As IFeatureSelection
Set pFSel = pFLayer
pFSel.SelectFeatures pqfilter, esriSelectionResultNew, False
Dim pSelSet As ISelectionSet
Set pSelSet = pFSel.SelectionSet

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

If pSelSet.Count > 1 Then

Dim pEnumGeom As IEnumGeometry
Dim pEnumGeomBind As IEnumGeometryBind

Set pEnumGeom = New EnumFeatureGeometry
Set pEnumGeomBind = pEnumGeom
pEnumGeomBind.BindGeometrySource Nothing, pSelSet

Dim pGeomFactory As IGeometryFactory
Set pGeomFactory = New GeometryEnvironment

Dim pGeom As IGeometry
Set pGeom = pGeomFactory.CreateGeometryFromEnumerator(pEnumGeo m)

pMxDoc.ActiveView.Extent = pGeom.Envelope

ElseIf pSelSet.Count = 1 Then
pSelSet.Search Nothing, True, pFcurs
Set pFeat = pFcurs.NextFeature
Set pEnvelope = pFeat.Extent
Debug.Print pEnvelope.Width
pEnvelope.Width = pEnvelope.Width + 1
pEnvelope.Height = pEnvelope.Height + 1
pEnvelope.Expand 50, 50, True
Debug.Print pEnvelope.Width
pMxDoc.ActiveView.Extent = pEnvelope

Else
MsgBox "error"
End If

pMxDoc.ActiveView.Refresh


'zoom out a little
Dim pActiveView As IActiveView
Dim pDisplayTransform As IDisplayTransformation

Dim pCenterPoint As IPoint

Set pActiveView = pMxDoc.FocusMap
Set pDisplayTransform =
pActiveView.ScreenDisplay.DisplayTransformation
Set pEnvelope = pDisplayTransform.VisibleBounds
'In this case, we could have set pEnvelope to IActiveView::Extent
'Set pEnvelope = pActiveView.Extent
Set pCenterPoint = New Point

pCenterPoint.X = ((pEnvelope.XMax - pEnvelope.XMin) / 2) +
pEnvelope.XMin
pCenterPoint.Y = ((pEnvelope.YMax - pEnvelope.YMin) / 2) +
pEnvelope.YMin
pEnvelope.Width = pEnvelope.Width * 1.1
pEnvelope.Height = pEnvelope.Height * 1.1
pEnvelope.CenterAt pCenterPoint
pDisplayTransform.VisibleBounds = pEnvelope
pActiveView.Refresh
FindIntersectionError:

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 + _
vbDefaultButton1, "SQL Error"
Exit Sub

Else

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


End Sub

You'll have to change the code as usual to suit your needs. Most
importantly set the layer from "IntersectLGA" 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*****@tiscalinet.it> wrote in message news:<cj**********@lacerta.tiscalinet.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*****@tiscalinet.it> wrote in message news:<cj**********@lacerta.tiscalinet.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
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...
0
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 >...
3
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...
1
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
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...
6
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...
1
by: anbumozhip | last post by:
is there any code for color ramp available like the one which is present in arcview or arcgis
0
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...
0
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.