How To Select Data from *.DBF files - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How To Select Data from *.DBF files

jitendra_katejitendra_kate Posts: 1Member

I am very new to foxpro file extraction programming using vb.net
plz help for following scenario.

I have a foxpro files of file extension

1) FOXUSER.DBF: which contains fields such as Type,Id,Name,Readonly,CkVal,
Data,Updated.

2) FOXUSER.FPT:fields same as above

3) Data_Needed.DBF :Contains fields such as
EmployeeID,EmployeeName,EmpolyeeAddress

I have created a function for selecting data from the foxpro file Data_Needed.DBF

But it gives error

"The Microsoft Jet database engine could not find the object 'Data_Needed'. Make sure the object exists and that you spell its name and the path name correctly."

I have troubleshooted a lot but no use although the files are present there in the location

my function is as below

==========================================
connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=D:DATA NeededData_Needed;Extended Properties=dBase III"

Dim dBaseConnection As New System.Data.OleDb.OleDbConnection(connectionString)

dBaseConnection.Open()

Dim dBaseCommand As New System.Data.OleDb.OleDbCommand("SELECT * FROM Data_Needed", dBaseConnection)

Dim dBaseDataReader As System.Data.OleDb.OleDbDataReader = dBaseCommand.ExecuteReader(CommandBehavior.SequentialAccess)

While dBaseDataReader.Read

ComboBox1.Items.Add("" & dBaseDataReader("EmployeeName") & "")

End While

dBaseConnection.Close()


==========================================================


Please Help me finding a solution

Thanks in Advance for all
Jiendra






Comments

  • seancampbellseancampbell Pennsylvania, USAPosts: 684Member ✭✭✭
    I have never dealt with a DBF file, but you might try this:
    connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=D:DATA NeededData_Needed.DBF;Extended Properties=dBase III"

    :
    : I am very new to foxpro file extraction programming using vb.net
    : plz help for following scenario.
    :
    : I have a foxpro files of file extension
    :
    : 1) FOXUSER.DBF: which contains fields such as
    : Type,Id,Name,Readonly,CkVal,
    : Data,Updated.
    :
    : 2) FOXUSER.FPT:fields same as above
    :
    : 3) Data_Needed.DBF :Contains fields such as
    : EmployeeID,EmployeeName,EmpolyeeAddress
    :
    : I have created a function for selecting data from the foxpro file
    : Data_Needed.DBF
    :
    : But it gives error
    :
    : "The Microsoft Jet database engine could not find the object
    : 'Data_Needed'. Make sure the object exists and that you spell its
    : name and the path name correctly."
    :
    : I have troubleshooted a lot but no use although the files are
    : present there in the location
    :
    : my function is as below
    :
    : ==========================================
    : connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    : "Data Source=D:DATA NeededData_Needed;Extended
    : Properties=dBase III"
    :
    : Dim dBaseConnection As New
    : System.Data.OleDb.OleDbConnection(connectionString)
    :
    : dBaseConnection.Open()
    :
    : Dim dBaseCommand As New
    : System.Data.OleDb.OleDbCommand("SELECT * FROM Data_Needed",
    : dBaseConnection)
    :
    : Dim dBaseDataReader As System.Data.OleDb.OleDbDataReader =
    : dBaseCommand.ExecuteReader(CommandBehavior.SequentialAccess)
    :
    : While dBaseDataReader.Read
    :
    : ComboBox1.Items.Add("" & dBaseDataReader("EmployeeName")
    : & "")
    :
    : End While
    :
    : dBaseConnection.Close()
    :
    :
    : ==========================================================
    :
    :
    : Please Help me finding a solution
    :
    : Thanks in Advance for all
    : Jiendra
    :
    :
    :
    :
    :
    :
    :
Sign In or Register to comment.