Creating Tables and setting properties in Access XP

  • Thread starter Thread starter Michael Henry
  • Start date Start date
M

Michael Henry

I'm trying to make a table through ADOX. The problem that
I am running into is that I have created a column of type
adDate. I would like to allow null entries for this
column. However when I try to use the properties method
to set the "Nullable" property I keep getting a run-time
error. Can anyone help....here is a snippet of my code.

Set colDateOfDeath = New ADOX.Column
colDateOfDeath = "DATE_OF_DEATH"
colDateOfDeath.Type = adDate
tblPatientData.Columns.Append colDateOfDeath
tblPatientData.Columns("DATE_OF_DEATH").Properties
("Nullable") = True

Thanks in advance,
Mike
 
I'm sorry: you're going to have to be able to predict the date of death for
all individuals (and do something to ensure that it's accurate).

Sorry, I couldn't resist. I believe you need to set the Nullable property
before you append the column to the table.

Set colDateOfDeath = New ADOX.Column
colDateOfDeath = "DATE_OF_DEATH"
colDateOfDeath.Type = adDate
colDateOfDeath.Properties("Nullable") = True
tblPatientData.Columns.Append colDateOfDeath
 
Doug,
I was getting good at predicting death outcomes but I
think my algorithm is still a little bit off......for now
I will still have to use the nullable property!!! hehe
Thanks for your help. That did work, however I did have
to set the ParentCatalog for the column before it will
allow you to set the nullable field to True. thanks
again for you help....
Mike Henry
 
Back
Top