In PowerShell, how do you access DAO enumeration constants, such as RecordsetTypeEnum dbOpenTable (1) or DataTypeEnum adVarNumeric (139)? Right now, I'm simply putting them in as magic numbers, but it would be much cleaner and easier to read to refer to the proper constants.
For RecordsetTypeEnum dbOpenTable (which comes from Access), you can use:
[Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Interop.Access.Dao") | Out-null
[int][Microsoft.Office.Interop.Access.Dao.RecordsetTypeEnum]::dbOpenTable
For DataTypeEnum adVarNumeric (which comes from ADODB, not Access) you can use:
[Reflection.Assembly]::LoadWithPartialName("ADODB") | Out-null
[int][ADODB.DataTypeEnum]::adVarNumeric