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

    --
     
    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?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Jennifer

    Linking Visual FoxPro 6 to Access2000

    Jennifer, Aug 7, 2003, in forum: Microsoft Access External Data
    Replies:
    0
    Views:
    705
    Jennifer
    Aug 7, 2003
  2. Robert

    Visual FoxPro 6.0 data

    Robert, Sep 19, 2003, in forum: Microsoft Access External Data
    Replies:
    1
    Views:
    284
    Robert
    Sep 19, 2003
  3. Phil

    Access 2000 - import FoxPro file

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

    Link Visual Foxpro with Code

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

    Using access to query a Visual FoxPro free table

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

    Can you import a foxpro .fpt file into Microsoft Access

    Guest, Sep 23, 2004, in forum: Microsoft Access External Data
    Replies:
    5
    Views:
    7,084
    Cindy Winegarden
    Sep 25, 2004
  7. 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:
    797
    Douglas J. Steele
    Jul 29, 2008
Loading...