Results 1 to 5 of 5

Thread: Help accessing foxpro dbf file

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2005
    Posts
    625

    Help accessing foxpro dbf file

    I need help accessing a DBF file that is in Foxpro. I am using Visual Basic .NET. I have the DBF file and a CDX file. I installed the Visual FoxPro OLE DB Provider 8. It seems to work when I create a connection and click 'Test Connection', but when I go to build a command, no tables show up. Any ideas?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help accessing foxpro dbf file

    What is the connect string that you are using?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2005
    Posts
    625

    Re: Help accessing foxpro dbf file

    This is the connection string. It was created by the connection creater in Visual Studio. I am told there is no security on the dbf file.


    User ID=;DSN=;Collating Sequence=MACHINE;Data Source="C:\DOCUMENTS AND SETTINGS\USERNAME\MY DOCUMENTS\DIRECTORY\FOXPRO\DATABASES";Provider="VFPOLEDB";Cache Authentication=False;Mask Password=False;persist security info=False;Mode="Read|Share Deny None";Extended Properties=;Encrypt Password=False

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help accessing foxpro dbf file

    I never trust wizards.

    This is the connection string for FoxPro, using .NET that http://www.connectionstrings.com/ has listed
    Code:
    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\folder;Extended Properties=dBASE IV;User ID=Admin;Password="

  5. #5
    Lively Member
    Join Date
    Apr 2005
    Posts
    91

    Re: Help accessing foxpro dbf file

    Hi, Try this

    VB Code:
    1. Imports System.Data
    2. Imports System.Data.OleDb
    3.     Use this for connecting to DBF File
    4.     Dim myConn As New OleDbConnection("Provider=VFPOLEDB.1;Data Source=C:\YourPath\Your.dbf;Password="""";Collating Sequence=MACHINE")
    5.  
    6.     Use this for connecting to DBC File
    7.     Dim myConn As New OleDbConnection("Provider=VFPOLEDB.1;Data Source=C:\YourPath\Your.dbc;Password="""";Collating Sequence=MACHINE")
    8.  
    9.     Dim myDataAdapter As New OleDbDataAdapter
    10.     Dim DS As DataSet = New DataSet
    11.    
    12.     myDataAdapter.SelectCommand = New OleDbCommand("Select * from Transactions", myConn)
    13.     myDataAdapter.Fill(DS, "Transactions")

Posting Permissions

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



Click Here to Expand Forum to Full Width