Results 1 to 5 of 5

Thread: ms access... linked tables?

  1. #1

    Thread Starter
    Hyperactive Member pgrimes's Avatar
    Join Date
    Aug 2001
    Location
    sacramento
    Posts
    342

    ms access... linked tables?

    Hi, I'm working with VB.NET and MS Access XP. I've been given a database and, I'm unfamiliar with it's format. It appears to be a "linked database" or a database with "linked tables" (terminology?). The name of the db is "kilopost.dbf". When I open it and view the table it contains (named "kilopost"), a new database file named "kilopost1.mdb" is created which, contains the same information as the "kilopost.dbf". This will repeat as many times as I view the table apparently (kilopost2.mdb, kilopost3.mdb, kilopost4.mdb... etc. will be created). Each one of those files contains a table named "kilopost" which is linked to "kilopost.dbf".

    Anyway, my problem is that I'm trying to read from this database using vb.net's "OleDbDataReader". I have no problem reading from my other .mdb files. Here is the error message produced when I try to access the kilopost database:

    VB Code:
    1. System.Data.OleDb.OleDbException: The Microsoft Jet database engine cannot find the input table or query 'kilopost'.  Make sure it exists and that its name is spelled correctly.
    2.    at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
    3.    at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
    4.    at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
    5.    at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
    6.    at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
    7.    at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
    8.    at CT_CPT_DB.Form1.btnPopLists_Click_1(Object sender, EventArgs e) in C:\Documents and Settings\Paul\My Documents\Work\VS_Proj\VB\Create_CPT_DB\CT_CPT_DB\Form1.vb:line 685
    The database does exist and the name and path are correct. I am successfully connecting to and reading from another .mdb in the same app.

    Here's a snippet of code:
    VB Code:
    1. Dim strSQL1 As String
    2.         Dim strSQL2 As String
    3.         Dim strSQL3 As String
    4.  
    5.         strSQL1 = "SELECT * FROM cty_rte_pm_ea"
    6.         strSQL2 = "SELECT * FROM kilopost"
    7.  
    8.         Dim cmdCptMetaData As New OleDbCommand(strSQL1, odbConnCptMetaData)
    9.         Dim cmdKilopost As New OleDbCommand(strSQL2, odbConnKilopost)
    10.  
    11.         odbConnCptMetaData.Open()
    12.         odbConnKilopost.Open()
    13.  
    14.         Try
    15.             Dim cptMetaDataReader As OleDbDataReader = _
    16.                             cmdCptMetaData.ExecuteReader(CommandBehavior.CloseConnection)
    17.             Dim cptKilopost_Reader As OleDbDataReader = _
    18.                             cmdKilopost.ExecuteReader(CommandBehavior.CloseConnection)

    Thanks for your help!

    Paul

  2. #2
    Hyperactive Member Foxer's Avatar
    Join Date
    Oct 2001
    Location
    Australia
    Posts
    278
    You lost me with all the .net stuff but on the issue of databases, a dbf file is a DBase file. An older file format that isn't used that often anymore.

    MS Access XP can link to a dBase file and read/write data to it even though it's not MS Access format. I suspect that's what you're dealing with.

    A MS Access XP file (mdb) that has links to a dBase file (dbf).

    Others can pick up the thread here ...
    Rate my response if I helped

    Go Hard Or Go Home


  3. #3

    Thread Starter
    Hyperactive Member pgrimes's Avatar
    Join Date
    Aug 2001
    Location
    sacramento
    Posts
    342
    Thanks, I tried saving it as an Access 2002 file (.mdb) but, it did nothing. Any other ideas? This is pretty urgent for me.

    Thanks

  4. #4

    Thread Starter
    Hyperactive Member pgrimes's Avatar
    Join Date
    Aug 2001
    Location
    sacramento
    Posts
    342
    *bump*

  5. #5

    Thread Starter
    Hyperactive Member pgrimes's Avatar
    Join Date
    Aug 2001
    Location
    sacramento
    Posts
    342
    I updated my Jet driver.... that did the trick.

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