Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 76931

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:45:02+00:00 2026-05-10T20:45:02+00:00

Access can open DBF (dBase) files, but instead of physically converting the data into

  • 0

Access can open DBF (dBase) files, but instead of physically converting the data into MDB format, it has the ability to link to the DBF table itself. This way the DBF is ‘linked’ to the MDB.

Is it possible to attach a DBF file in such manner using C#?

Edit: I would like to use Jet and avoid using MS Access directly.

  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:45:03+00:00Added an answer on May 10, 2026 at 8:45 pm

    Perhaps this code from How to quickly copy tables from an ODBC source to MS Access within a C# project might help:

    The VB function you’ll need to put into MS Access is quite simple, and basically calls the TransferDatabase method by passing it a DSN (pointing to the source database), a source table name and target table name. The code is as follows:

    Public Function Import(dsnName As String, sourceTableName As String, targetTableName As String) ‘ if the table already existsm, delete it.    On Error GoTo CopyTable    DoCmd.DeleteObject acTable, targetTableName CopyTable:    DoCmd.TransferDatabase _    acImport, _    'ODBC Database', _    'ODBC;DSN=' + dsnName, _    acTable, _    sourceTableName, _    targetTableName End Function 

    Changing the VBA to read acLink rather than acImport should allow linking.

    And then the C# code:

    object accessObject = null; try {    accessObject = Activator.CreateInstance(Type.GetTypeFromProgID('Access.Application'));     accessObject.GetType().InvokeMember(       'OpenCurrentDatabase',       System.Reflection.BindingFlags.Default  System.Reflection.BindingFlags.InvokeMethod,       null,       accessObject,       new Object[] { 'AccessDbase.mdb' });     accessObject.GetType().InvokeMember(       'Run',       System.Reflection.BindingFlags.Default  System.Reflection.BindingFlags.InvokeMethod,       null,       accessObject,       new Object[] { 'Import', 'DSN Name', 'Source table name', 'Target table name' });     accessObject.GetType().InvokeMember(       'CloseCurrentDatabase',       System.Reflection.BindingFlags.Default  System.Reflection.BindingFlags.InvokeMethod,       null,       accessObject,       null);     MessageBox.Show('Copy succeeded.'); } catch (Exception ex) {    string message = ex.Message;    while (ex.InnerException != null)    {       ex = ex.InnerException;       message += '\r\n----\r\n' + ex.Message;    }    MessageBox.Show(message); } finally {    if (accessObject != null)    {       System.Runtime.InteropServices.Marshal.ReleaseComObject(accessObject);       accessObject = null;    } } 

    Edit re comments

    I cannot help with c#, but here is some VBScript that links a table from one MDB to another.

    strLinkFile = 'C:\Docs\Link.mdb' strAccessFile = 'C:\Docs\LTD.mdb'  'Create Link... ' Set cn = CreateObject('ADODB.Connection') cn.Open 'Provider=Microsoft.Jet.OLEDB.4.0;' & _        'Data Source=' & strAccessFile & ';' & _        'Persist Security Info=False'  Set adoCat = CreateObject('ADOX.Catalog') Set adoCat.ActiveConnection = cn  Set adoTbl = CreateObject('ADOX.Table')  Set adoTbl.ParentCatalog = adoCat adoTbl.Name = 'LinkTable'  adoTbl.properties('Jet OLEDB:Link Datasource') = strLinkFile adoTbl.properties('Jet OLEDB:Link Provider String') = 'MS Access' adoTbl.properties('Jet OLEDB:Remote Table Name') = 'Table1' adoTbl.properties('Jet OLEDB:Create Link') = True  'Append the table to the tables collection ' adoCat.Tables.Append adoTbl 

    It is modified from: http://support.microsoft.com/kb/240222

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 213k
  • Answers 213k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you want to update the DIV based on the… May 12, 2026 at 10:30 pm
  • Editorial Team
    Editorial Team added an answer This white-paper is perhaps the best source of information I… May 12, 2026 at 10:30 pm
  • Editorial Team
    Editorial Team added an answer You could try an online YUI Compressor. This is the… May 12, 2026 at 10:30 pm

Related Questions

In flash you can open a file on the user's computer. In flash 9
According to ADC documentation: You can access Open Firmware this by holding down Command-Option-O-F
How can I access a XML Excel format file with an OLE Connection? Can
I am writing a custom wrapper for open_flash_chart plugin. It's placed in /lib and

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.