|
-
Mar 17th, 2004, 05:29 PM
#1
Thread Starter
Hyperactive Member
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:
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.
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr)
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
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:
Dim strSQL1 As String
Dim strSQL2 As String
Dim strSQL3 As String
strSQL1 = "SELECT * FROM cty_rte_pm_ea"
strSQL2 = "SELECT * FROM kilopost"
Dim cmdCptMetaData As New OleDbCommand(strSQL1, odbConnCptMetaData)
Dim cmdKilopost As New OleDbCommand(strSQL2, odbConnKilopost)
odbConnCptMetaData.Open()
odbConnKilopost.Open()
Try
Dim cptMetaDataReader As OleDbDataReader = _
cmdCptMetaData.ExecuteReader(CommandBehavior.CloseConnection)
Dim cptKilopost_Reader As OleDbDataReader = _
cmdKilopost.ExecuteReader(CommandBehavior.CloseConnection)
Thanks for your help!
Paul
-
Mar 17th, 2004, 06:23 PM
#2
Hyperactive Member
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
-
Mar 17th, 2004, 08:41 PM
#3
Thread Starter
Hyperactive Member
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
-
Mar 18th, 2004, 06:18 PM
#4
Thread Starter
Hyperactive Member
-
Mar 18th, 2004, 11:32 PM
#5
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|