I am a rookie looking to display Mappoint data from a SQL Database. Funny thing is, I know how to input all the records using the mappoint object, but I cannot see them! I know they are there because when I execute a .printout method, I see the data, but for some reason I am not displaying the records on my control. I could have sworn a friend used an image control or something other than the *.ocx (which I do not believe is on my machine.) Any help would be appreciated.
Here's my code: also, my mappoint control is named mpNA for "North America". ELR
PS I do realize I've commented out the while / wend. I just wanted to map one object and then see it for now. I will worry about mapping all the records as soon as I figure this out. ELR
PLEASE EMAIL ME AT ELIAS.RODRIGUEZ@MINDSPRING.COM
Private Sub cmdSearch_Click()
Dim cn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=MLS;Data Source=192.168.1.101;Password=.saile"
cn.Open
Set rst = New ADODB.Recordset
rst.Open "select * " & _
"from idxarkmls1 " & _
"where town='" & txtCity.Text & " " & cboState.Text & "'", cn
'While Not rst.EOF
Set objLoc = objMap.Find("Rogers" & "," & cboState.Text)
objLoc.GoTo
'// Create a new pushpin
Set objPushPin = objMap.AddPushpin(objLoc, strLocationText)
'// Display the balloon
objPushPin.BalloonState = geoDisplayBalloon
'// Change pushpin symbol to one of the standard symbols
'// 26 is a yellow circle
objPushPin.Symbol = 26
objPushPin.Highlight = True
objPushPin.Note = "This is the address you selected!"
rst.MoveNext
'Wend
'objMap.PrintOut
rst.Close
cn.Close
Set rst = Nothing
Set cn = Nothing
End Sub