"unrecognized database format" 2007 fillschema

T

tbuffaloe

I have an Access 2003 format MDB with 530 of defined tables. The
tables have no data in them and on a machine that has office 2003 all
tables can be opened, and structure can be checked using Access 2003.

However, opening the same file (or a copy of the same file) on a
machine with office 2007 opens the MDB fine, but on some tables
results in Unrecognized database format error. Which happens to be the
last table definition that was added to the MDB.

If I use VS.NET to read the table structures the
OleDbDataAdapter.FillSchema will not return an error but does not
succeed in reading the same table that Access 2007 cannot reference.

FillSchema(oDS, SchemaType.Source, strTableName);

If Office 2007 is removed from the machine in question but Office 2003
remains the MDB behaves normally again.

Any ideas what is happening that affects the MDB, or how to avoid this
issue?

Sample code: that works on a machine with Office 2003 or earlier
versions.
/// 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);
DAGeneric.Fill(oDS, strTableName); ///this is where the error
occurs with office 2007.
}
 
T

Tony Toews [MVP]

I have an Access 2003 format MDB with 530 of defined tables.

Jeff has already replied to your question in another posting of yours.

I suspect you've come across an internal limitation of Access. And
like Jeff I would wonder if most/all of those should be combined into
a few tables.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

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