Import Visual FoxPro file using code

Discussion in 'Microsoft Access External Data' started by amanda battye via AccessMonster.com, Apr 12, 2005.

  1. I have regularly been importing Visual Foxpro files into my access
    database. I now want to automate this procedure with code/macro. However
    I'm having trouble with the sytax.

    To get the Database Name property, I linked the required table and looked
    at the table properties as suggested in the help file. However, it looks
    like there are too many arguments within it to me.

    Also not really sure what to put for source and destination.

    This is the code I have so far:
    DoCmd.TransferDatabase acImport, "ODBC", "ODBC;DSN=Visual FoxPro Tables;" &
    _
    "SourceDB=U:\Coldharbour\Comp_B.DBC;SourceType=DBC;Exclusive=No;" & _
    "BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;;TABLE=wname", _
    acTable, "u:\coldharbour\Comp_B.DBC", "wname_b", False

    any help would be much appreciated.

    Amanda

    --
    Message posted via http://www.accessmonster.com
     
    amanda battye via AccessMonster.com, Apr 12, 2005
    #1
    1. Advertisements

  2. Hi Amanda.

    I notice in your connection string you refer to file names like x.DBC. If
    there is a DBC file present then the tables were created with Visual Foxpro
    and you will need to use the Visual FoxPro ODBC driver, available from
    http://msdn.microsoft.com/vfoxpro/downloads/updates .

    --
    Cindy Winegarden MCSD, Microsoft Visual Foxpro MVP
    www.cindywinegarden.com
    Blog: http://spaces.msn.com/members/cindywinegarden


    "amanda battye via AccessMonster.com" <> wrote
    in message news:...
    >I have regularly been importing Visual Foxpro files into my access
    > database. I now want to automate this procedure with code/macro. However
    > I'm having trouble with the sytax.
    >
    > To get the Database Name property, I linked the required table and looked
    > at the table properties as suggested in the help file. However, it looks
    > like there are too many arguments within it to me.
    >
    > Also not really sure what to put for source and destination.
    >
    > This is the code I have so far:
    > DoCmd.TransferDatabase acImport, "ODBC", "ODBC;DSN=Visual FoxPro Tables;"
    > &
    > _
    > "SourceDB=U:\Coldharbour\Comp_B.DBC;SourceType=DBC;Exclusive=No;" & _
    > "BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;;TABLE=wname", _
    > acTable, "u:\coldharbour\Comp_B.DBC", "wname_b", False
     
    Cindy Winegarden, Apr 13, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phil

    Access 2000 - import FoxPro file

    Phil, Oct 31, 2003, in forum: Microsoft Access External Data
    Replies:
    0
    Views:
    254
  2. sapta

    Link Visual Foxpro with Code

    sapta, Nov 11, 2003, in forum: Microsoft Access External Data
    Replies:
    0
    Views:
    228
    sapta
    Nov 11, 2003
  3. Guest

    Using access to query a Visual FoxPro free table

    Guest, Jun 27, 2004, in forum: Microsoft Access External Data
    Replies:
    1
    Views:
    297
    Cindy Winegarden
    Jun 28, 2004
  4. Guest

    Can you import a foxpro .fpt file into Microsoft Access

    Guest, Sep 23, 2004, in forum: Microsoft Access External Data
    Replies:
    5
    Views:
    5,163
    Cindy Winegarden
    Sep 25, 2004
  5. vvenk

    How do I use OLEDB to link to a Visual FoxPro file

    vvenk, Jul 29, 2008, in forum: Microsoft Access External Data
    Replies:
    1
    Views:
    664
    Douglas J. Steele
    Jul 29, 2008
Loading...

Share This Page