View Single Post

  #1 (permalink)  
Old 11-15-2004
Boelling Boelling is offline
Junior Member
White Belt
 
Join Date: Nov 2004
Posts: 3
Using LinkData to connect over UDL-File to MSDE/SQL-Server

Hi,

I want to link geographic data with the DataSets.LinkData-Method. My Data is stored in a MSDE/SQL-Server-Database. I want to connect to the database over an UDL-File. I have longitude an latitude-values (data-type floating) in the database for faster linking to the data.

The manual connection over the UDL-File to the MSDE/SQL-Server-Database with the DataSets.ShowLinkWizard-Method works fine. But the Link-Data-method fails.

Does anybody have a working example for using the LinkData-method to connect over an UDL-File to an MSDE/SQL-Server Database with Lat/Lon-values?

My (not working) example:

Dim aArrayOfFields(1 To 2, 1 To 2) As Variant
aArrayOfFields(1, 2) = "Longitude"
aArrayOfFields(2, 1) = geoFieldLongitude
aArrayOfFields(1, 2) = "Latitude"
aArrayOfFields(2, 1) = geoFieldLatitude

Dim strPrimaryKey As Variant
strPrimaryKey = "ID"

Dim oDataSet As MapPointCtl.DataSet
Set oDataSet = Me.MappointControl1.ActiveMap.DataSets.LinkData(Ap p.Path & "\Data\Datalink.udl!geodata", strPrimaryKey, aArrayOfFields)

Thank you,

Sebastian Bölling
Reply With Quote