ADOX OLE DB multi-step operation generated errors

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); // SoftwareTable TurnOffAllowZeroLengthInAllFields(catDatabase,"Software"); TurnOffUnicodeCompressionInField(catDatabase, "Software", "Description"); TurnOffUnicodeCompressionInField(catDatabase, "Software", "Name"); } } 
+6
c # ms-access adox
source share
1 answer

You should check your lines for characters that do not have corresponding UNICODE values, you can often enter them when copying and pasting text from an application such as MS Word. In particular, smart quotes often cause problems.

Also consider the following thread (although it is in C ++) A discussion of using ADOX in C ++ .

Can you scroll through properties and display their current values?

0
source share

All Articles