"Unrecognized database format" 2007

T

tbuffaloe

I have a very confusing situation. An MDB with 530 tables The last
table added has 97 fields defined, 93 text fields of varying lengths,
3 number fields, 1 memo field.

With a machine with office 2003 this MDB opens correctly and
referencing the tables functions completely normally.

The same file (or a copy) placed on a machine with office 2007 returns
the error message when the specific table is referenced.

Copy back to the orignal machine and the access 2003 can access the
tables without issue.

Help!!!.

I have also created a VS.NET application to read the tables out of the
MDB, and the utility has the same results.

Below is the code snippet identifying where the error occurs. On a
machine with office 2003 this code functions normally and without
error, on a machine with office 2007 the error actually starts when
trying to read the schema from the MDB file.

using System;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Globalization;
....
public class DataExportObj
{
private OleDbConnection m_connGeneric;
private string m_strExePath;
static public string m_sSepChar = "|";

/// <summary>
/// DataExportObj - Constructor.
/// </summary>
/// <param name="oDS"> Output dataset</param>
/// <param name="strTableName"> Database table name</param>
public DataExportObj(ref DataSet oDS, string strTableName)
{
//
// Identify where the program was run from to find the export
reference database.
//
string codebasefile =
System.Reflection.Assembly.GetExecutingAssembly().Location;
m_strExePath = Path.GetDirectoryName(codebasefile);
m_strExePath = Path.Combine(m_strExePath, "CSVDef.mdb");

m_connGeneric = new OleDbConnection();
m_connGeneric.ConnectionString = "Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=1;Data
Source="
+ m_strExePath + ";Jet OLEDB:Engine Type=5;Jet OLEDB:Global Bulk
Transactions=1;Provider=\"Microsoft.Jet.OLEDB.4.0\";Jet
OLEDB:SFP=False;Mode=Share Deny None;Jet OLEDB:Create System
Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet
OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet
OLEDB:Encrypt Database=False";
m_connGeneric.Open();
AddTable(ref oDS, strTableName);
}

/// <summary>
/// AddTable - Add a table to the existing dataset.
/// </summary>
/// <param name="oDS"> Output dataset</param>
/// <param name="strTableName"> Database table name</param>
public void AddTable(ref DataSet oDS, string strTableName)
{
OleDbCommand selectCmd;
selectCmd = new OleDbCommand("SELECT * FROM " + strTableName,
m_connGeneric);
OleDbDataAdapter DAGeneric = new OleDbDataAdapter(selectCmd);
DAGeneric.FillSchema(oDS, SchemaType.Source, strTableName); // on
the table in question this call fails to load the Schema into the
DataSet.
DAGeneric.Fill(oDS, strTableName); //Error reported occurs here
}
 
J

Jeff Boyce

I won't be able to help with the error condition, but I will suggest that
you reconsider what you are calling an Access database.

Access is not a spreadsheet, and you won't get the best use of its features
and functions if you feed it 'sheet data.

In a well-normalized Access database, it would be quite unlikely for any one
table to need as many as 30 fields... having 97 fields points to the
possibility that the data isn't normalized.

And having 530 tables seems to me to be (potentially) unusual too. Is there
any chance that these tables are being used to "categorize" data? For
example, do you have tables for January2006, February2006, ...(month/year
data), or Product1, Product2, ... (product-specific data)? Like 'repeating
fields', tables with categorization embedded in the table name begs for a
reexamination and further normalization.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top