Access hyperlink

Hallo zusammen,

Ich habe ein sehr schoenes script, dass mir mit der hyperlinkfunktion ein passendes accessformular oeffnet, wenn ich auf das entsprechende symbol klicke. Das hat in Arcview 8.3 und mit Access 9.0 und windows 2000 vor einem halben jahr bestens funktioniert. jetzt haben wir die arcview 9er version, Access 11.0 und XP. nun tut sich gar nix, ich bekomm nicht mal ne fehlermeldung, bzw die hyperlinkfunktion erkennt beim klicken nicht mal, das sich sich am richtigen Punkt befindet 9oder sollte). Kann das an den jeweils neueren versionen liegen??

Hab mal das entsprechende script dran gehaengt:

'The following VBScript is based on the GOTOaccess.zip script created by
'Steve Carson and posted on the ESRI site. It was modified on September 11, 2003
'by Kristina Callahan

'This script will hyperlink from a feature in ArcMap to a filtered form in
'Microsoft Access. Works for me using ArcGIS 8.2, Access 2000, and Windows 2000.

'The following modifications were made:
' (1) the original script required that the Access form be open. I added code
' that will launch the database and form from a hard-coded location.
' (2) the original script passed a number variable from ArcMap to Access. I
' modified the SQL statement to accomodate strings which required using Chr(34)
' to represent ASCII character for double quotes. SQL requires strings
' to be in quotation marks.
' (3) comments were added to (hopefully) make using the script a little
' easier.

'Import this module into ArcMap
' (1) Open VBE by selecting Tools|Macros|Visual Basic Editor
' (2) Select File|Import File and navigate and open AccessHyperlink.bas. This should
' add the module to the Project document(not the Normal document)
' (3) Select Tools|References and check the reference to 'Microsoft Access 9.0
' Object Library'
' (4) Replace "E:\bird.mdb" with the location and name of the database you want
' to use
' (2) Replace "e:\" with the drive letter so it is the same drive as (4)
' (3) Replace "frmLocation" with the name of the form you want to filter
' (4) Modify ("[LocationID]=" & Chr(34) & thestring & Chr(34)) - replace [LocationID] with
' with the name of the field you want to filter on. Note that you must use
' Chr(34) to represent double quotes if you are passing a string. You do not
' need it if you are passing a number.
' (5) Close VBE and return to ArcMap
' (6) Open the Layer Properties for the layer you want to hyperlink from and navigate
' to Display|Hyperlink
' (7) Check the box next to support hyperlinks and select the field you want to use.
' Select Macro and copy and paste Project.AccessHyperlink.Hyperlink into the box.
' Do not click Create.
' (8) Click OK to exit the Layer Properties window and try the hyperlink tool.


Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation _
As String, ByVal lpFile As String, ByVal lpParameters _
As String, ByVal lpDirectory As String, ByVal nShowCmd _
As Long) As Long

Declare Function apiFindWindow Lib "User32" Alias "FindWindowA" _
(ByVal lpclassname As Any, ByVal lpCaption As Any) As Long

Global Const SW_SHOWNORMAL = 1




Sub Hyperlink(pLink, pLayer)

On Error GoTo eh:

Dim pHyperlink As IHyperlink
Set pHyperlink = pLink
Dim pFLayer As IFeatureLayer
Set pFLayer = pLayer
Dim thestring As String
thestring = pHyperlink.Link

Dim hwnd
Dim StartDoc
hwnd = apiFindWindow("OPUSAPP", "0")

'opens Microsoft Access database
StartDoc = ShellExecute(hwnd, "open", "G:\ENV\Hazwaste\unsec_GIS-VAWS2004.mdb", "", "G:\", SW_SHOWNORMAL)

Dim Accapp As Access.Application
Set Accapp = GetObject("G:\ENV\Hazwaste\unsec_GIS-VAWS2004.mdb")


Accapp.DoCmd.OpenForm "Anlagenliste", acNormal, , "[Anlagennummer]=" & thestring

Exit Sub

eh:
MsgBox "Something isn't working!"

End Sub






Vielen Dank christoph
Hallo Christoph!

Versuch doch mal diese Extension von NPS Alaska unter diesem Link.

http://www.nps.gov/akso/gis/av31/arc2ax.htm


Das ArcGIS to Access Link v1.0 ist kostenlos und sogar bi-direktional einsetzbar. Man damit also nicht nur von ArcGIS 9.0 auf das per Primärschlüssel verlinkte AccessForumular linken, sondern auch per Button vom Access Forumlar auf den jeweiligen Punkt/Linie/Polygon in ArcGIS zoomen.
Ich finds genial. Das sollte Deine Probleme lösen!

Grüße Sindbad
Vielen Dank,
wenn ich meinen administrator ueberzeugen kann, dass ichs runterladen darf und installieren, ists sicher klasse!

Danke Sindbad

Gruss christoph