0

I'm trying to set an MS Accessa date/time column format using ADOX. Here's an example of my code:

Column col = new Column();
col.Name = "name";
col.Type = DataTypeEnum.adDate

And so far, it's working. What i need to do is setting this date/time column format to "short date".

I've tried something like this:

col.Properties["Format"].Value = "short date";

... but it's not working.

Handryck
  • 9
  • 1
  • 5
  • You are very close... try col.Properties["Format"].Value = "Short Date"; – donPablo Jul 08 '18 at 05:41
  • Just tried. It doesn't work. – Handryck Jul 08 '18 at 06:35
  • I added code to look at the 15 Properties but did not find Format. Other research sez do via SQL to do an Alter Table Alter Column ... and set it that way. I am away for a week. ADOX.Properties props = col.Properties; for (int i = 0; i < props.Count; i++) { Debug.Print(i + " " + props[i].Name + " " + props[i].Value); } – donPablo Jul 08 '18 at 21:05

0 Answers0