Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Set an Access field "not" required w/ADO
Please help if possible.
Does anyone know if it is possible to change a field from "Required" to not-required after the table has been constructed (but before data is added) using ADO from Excel VBA? My code follows. It produces RTE "-2147217887 (80040e21) Multiple Step OLE DB operation generated errors...no work was done." If you know how to do this (or if it is possible any other way i.e. using conventional VBA) please submit your example code. I would be most appreciative. Thanks in advance. Function ADOAccessFieldNullable(argFullName As String, argTableName As String) Dim cat As New ADOX.Catalog Dim tbl As ADOX.Table Dim col As ADOX.Column Dim cols As ADOX.Columns cat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & argFullName & ";" Set tbl = cat.Tables(argTableName) Set cols = tbl.Columns For Each col In cols col.Attributes = adColNullable Next col cols.Refresh Set cat = Nothing End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing" | Excel Discussion (Misc queries) | |||
Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing" | Excel Discussion (Misc queries) | |||
How to set the default "summarized by" of a data field to "Sum"? | Excel Discussion (Misc queries) | |||
Pivot Tables - How can I "reset" the selections in "Row Field"? | Excel Discussion (Misc queries) |