Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET Database and Reporting > Microsoft Jet database engine could not find the object


Reply
 
Thread Tools Display Modes
  #1  
Old 07-07-2012, 05:43 AM
phezo phezo is offline
Newcomer
 
Join Date: Aug 2005
Posts: 2
Default Microsoft Jet database engine could not find the object


Hi all,
I am experiencing an issue with connecting to a Dbase .dbf file, the file is from a customer who has no information regarding its operation.
I have a .dbf and a .mdx I can see the file is a Dbase III file and the multiple index file.

I am seeing the following error when I attempt to fill my adapter,
The Microsoft Jet database engine could not find the object 'NEW_DATABASE.DBF'. Make sure the object exists and that you spell its name and the path name correctly.

Couls someone please look over my code to see if I have any school boy errors in it...

Code:
Public Sub RetrieveDataFromLabelDataBase(PurchaseOrder As String)
        Dim connectionString As String
        Dim connection As OleDbConnection
        Dim oledbAdapter As OleDbDataAdapter
        Dim ds As New DataSet
        Dim sql As String
        Dim i As Integer
        Dim MyServTagData As New LabelDbaseData



        connectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=j:\" & ";Extended Properties=dBase III;"
        sql = "SELECT *   FROM [NEW_DATABASE#DBF]" ' WHERE PO_NUMBER = 000101011627"

        Try
            connection = New OleDbConnection(connectionString)
            connection.Open()
            Dim mytables As DataTable
            mytables = connection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
            For i = 0 To mytables.Rows.Count - 1
                Debug.Print(mytables.Rows(i)!TABLE_NAME.ToString)
            Next i

            oledbAdapter = New OleDbDataAdapter(sql, connection)
            oledbAdapter.Fill(ds, "PO_NUMBER")

            oledbAdapter.Dispose()
            connection.Close()


        Catch ex As Exception
            MsgBox("Can not open connection ! ")
        End Try

    End Sub
Thanks for having a look...

BR
Phezo...
Reply With Quote
  #2  
Old 07-07-2012, 02:42 PM
phezo phezo is offline
Newcomer
 
Join Date: Aug 2005
Posts: 2
Default Initial Problem Solved, "However!"

Solution to my Initial problem...

Ive worked out that the connection string with the provider only accepts the Dos 8.3 file naming convention...

I can now connect and retrieve data from the DB using the connection string,

Code:
connectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=j:\" & ";Extended Properties=dBase III;"
and renaming the datbase from NEW_DATABASE.DBF to NEW_DATA.DBF, this has allowed me to apply the following sql statement.

Reworked SQL statement..., change point in bold with file name changed also.
Code:
 sql = "Select * FROM NEW_DATA"
This now allows the dataset to be filled, previously I had the "Microsoft Jet database engine could not find the object" error.

Hopefully this information assists someone else in a similar situation...

My next question would be ofcourse..

How do i get around the 8.3 file format restriction, based on the assumption that I cannot rename the original file, I can ofcourse copy the file to a file name convention that suites, however I prefer to avoid this work around if possible.

I expect that there may be an alternative option, maybe to use a different driver to connect to the .DBF file so that this 8.3 file format issue would be negated.

Based on that last assumption can anyone please advise me of a different driver setup to access the .DBF .MDX files???

OR Alternatively all ideas are welcome, in my opinion its best to ask the expert and draw from others experience when possible..

Any advice is appreciated, please assist if possible..

VBR
Phezo
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->