Results 1 to 3 of 3
  1. #1
    MarkGallie is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2013
    Posts
    5

    Importing a FoxPro table using VBA

    I'm trying to import a few tables from a FoxPro database into an Access Database using VBA code. I know I have done it before and I remember struggling with the format last time. Can anyone see where I'm going wrong?



    DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;DSN=Hiremate;SourceDB=\\data-ww\apps\hmfox32\data\hiremate.dbc;SourceType=DBC;E xclusive=No;BackgroundFetch=Yes;Collate=Machine;Nu ll=Yes;Deleted=Yes", acTable, "hires"

    The error I'm receiving is:

    Run-time error '3011': The Microsoft Access database engine could not find the object ". Make sure the object exists and that you spell its name and path name correctly.

    Which part of the statement is this referring to? The table names and paths are spelt correctly so I assume this is an issue with the format of the statement.

    Thanks

  2. #2
    MarkGallie is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Apr 2013
    Posts
    5
    Having added quotations around both the DSN and SourceDB strings as follows:

    DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;DSN='Hiremate';SourceDB='\\data-ww\apps\hmfox32\data\hiremate.dbc';SourceType=DBC; Exclusive=No;BackgroundFetch=Yes;Collate=Machine;N ull=Yes;Deleted=Yes", acTable, "hires"

    I now get the error:

    ODBC-Connection to "Hiremate" failed.

    However, I know that the connection works as I can perform the import manually.

  3. #3
    cplmckenzie is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    25
    MarkGallie,

    What version of Foxpro are you using and do you have a sample foxpro file you are using.

    cplmckenzie

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 01-05-2013, 02:32 PM
  2. Visual Foxpro database Disappeared from ODBC
    By Vinod in forum Import/Export Data
    Replies: 1
    Last Post: 10-20-2011, 09:58 AM
  3. Connect Foxpro table in access
    By genny in forum Import/Export Data
    Replies: 6
    Last Post: 11-08-2010, 02:31 AM
  4. foxpro in access
    By meysam_e2006 in forum Import/Export Data
    Replies: 0
    Last Post: 06-28-2010, 02:17 AM
  5. Access vs FoxPro
    By khuram in forum Access
    Replies: 5
    Last Post: 06-16-2009, 11:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums