If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Change columnís properties values

How do I change all the column values (Nullable=True and Allow Zero Length=True) in a table except PersonalID column? When the script is executed I get the error "-2147217887 - Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done." This is the code only for one table.I need to create more tables so setting Nullable property of each column is not practical.Please Help!
Here is the code

Public Sub DBcreation()
Dim tbl As New Table
Dim cat As New ADOX.Catalog
Dim col As ADOX.Column
Dim prp As ADOX.Property
Dim oCn As ADODB.Connection
Dim sConStr As String

End With
' 5) Save the Table to the DataBase
cat.Tables.Append tbl
' 6) Set Column Properties
For Each col In tbl.Columns
For Each prp In col.Properties
If col.Name <> "PersonalID" Then
If prp.Name = "Nullable" Then
prp.Value = True 'error generated
'-2147217887 - Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
End If
End If
Next
Next

Re: Change columnís properties values

after execution of cat.Tables.Append tbl I get the error message "-2147217859 - Type is invalid."Even after adding on error resume next the loop is infinite. I even changed "Jet OLEDB:Engine Type=5" to Type=4 but the error is same.