Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
raj raj is offline
external usenet poster
 
Posts: 32
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing" ldiaz Excel Discussion (Misc queries) 2 March 16th 08 09:23 PM
Run macro only if Field E10 = "WO ID" and AB10 = "Spec Sizing" ldiaz Excel Discussion (Misc queries) 2 March 15th 08 07:26 PM
How to set the default "summarized by" of a data field to "Sum"? Jeffrey Excel Discussion (Misc queries) 1 June 4th 06 01:29 PM
Pivot Tables - How can I "reset" the selections in "Row Field"? shadestreet Excel Discussion (Misc queries) 3 April 24th 06 06:29 PM


All times are GMT +1. The time now is 06:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"