I need to create a program that will disable all Unicode compression and all "allow zero length" in the access database (.mdb).
The disable method Allow Zero Length works very well. However, the Unicode compression disable method does not work at all and returns the following exception:
OLE DB steps with multiple steps generated errors. Check each OLE DB status value, if available. There was no work.
Is there any clue on how to solve this?
private void TurnOffUnicodeCompressionInField(ADOX.CatalogClass catalogClass, String tableName, String field) { ADOX.Column column = catalogClass.Tables[tableName].Columns[field]; ADOX.Property prop = column.Properties["Jet OLEDB:Compressed UNICODE Strings"]; prop.Value = true; } private void TurnOffAllowZeroLengthInAllFields(ADOX.CatalogClass catalogClass, String tableName) { foreach (ADOX.Column column in catalogClass.Tables[tableName].Columns) column.Properties["Jet OLEDB:Allow Zero Length"].Value = false; } private void MyButton_Click(object sender, EventArgs e) { String filePath = ""; OpenFileDialog ofd = new OpenFileDialog(); DialogResult result = ofd.ShowDialog(); if (result == DialogResult.OK) { filePath = ofd.FileName; ADOX.CatalogClass catDatabase = new ADOX.CatalogClass(); catDatabase.let_ActiveConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filePath);
c # ms-access adox
Madseb
source share