Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 4 of 4

giving an error while compiling....

This is a discussion on giving an error while compiling.... within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, I am facing an compilation problem error:"Cannot import data because a connection to the database could not be established" ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    giving an error while compiling....

    Hi,

    I am facing an compilation problem error:"Cannot import data because a connection to the database could not be established"

    This is the code snippet:

    please anyone kindly help me :

    1.I am trying to get the one coulmn of records from table and want to map .

    plz any other suggestions would be great....
    ************************************************** *********
    Private Sub Form_Load()

    Dim MPApp As New MapPoint.Application
    Dim objMap As MapPoint.Map
    Dim objLoc As MapPoint.Location
    Dim szconn As String
    Dim oDS As MapPoint.DataSet

    Set objMap = MPApp.ActiveMap
    MPApp.Visible = True
    MPApp.UserControl = True




    With MPApp.ActiveMap.DataSets


    'Access database with a query
    szconn = MPApp.Path & "\Desktop\FirstMap\ED Conference March 2003 expanded.mdb!ZIP"
    Set oDS = .ImportData(szconn, , geoCountryUnitedStates, , geoImportAccessQuery)


    End With


    End Sub


    ************************************************** ***********

    thanks
    Munna

  2. #2
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4
    Just some ideas.. do you have access installed on the machine? it might need to be.

    Also, check the path (e.g. MsgBox szConn) right before the Set oDS statement.

    Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  3. #3
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Mappoint giving an error while compiling....

    The way you have your code; your access database must be found in
    the same location as the MPApp.Path.
    Also you have subdirectories liste as well
    "\Desktop\FirstMap\ED Conference March 2003 expanded.mdb

    All of these folder must be under MPApp.Path ( Whatever MPApp.Path location is).

    Hope this helps

  4. #4
    Fer
    Fer is offline Junior Member White Belt
    Join Date
    Jun 2003
    Posts
    11
    Sounds like it could be a db location problem. I think Eric's suggestion of printing the path is a good one so that way you'll see exactly where it's looking for the db. You could also try to put your access db in for example C:\ and use the hardcoded path in your app:

    szconn = "C:\ED Conference March 2003 expanded.mdb!ZIP"

    that way you'll verify if the error arises from an unlocated db or if it's another issue.


    Fernando

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. synchronous error
    By Wilfried in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 06-09-2005, 04:27 AM
  2. Mappoint Error
    By Mudrover in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 01-20-2005, 02:59 PM
  3. error 4014
    By SimonPearse in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 01-17-2005, 10:47 AM
  4. About ERROR 4-40028-1. Error or Bug ?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 12
    Last Post: 01-11-2005, 09:32 AM
  5. I get this following error
    By ananthdeena in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 01-01-2005, 02:46 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83