Re: ADOX - Access table creation with nullable columns.




"Ralph" <nt_consulting64@xxxxxxxxx> wrote in message
news:%23w4GWShIIHA.4480@xxxxxxxxxxxxxxxxxxxxxxx

"Andy" <Andy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2E4C90C7-8C7B-482A-B4B0-622CFF47BC19@xxxxxxxxxxxxxxxx
Thanks for the advice. I've tried to access the properties associated
with
the Column object and hoped to enumerate through them to identify their
names
(Can't find any documentation on what these are!). I can get a pointer
to
the
properties interface only to find the property count equals zero. What
am
I
missing here?

VB code may help me - I hope the principles will be the same...

ADOX::_ColumnPtr m_pColumn;
TESTHR(m_pColumn.CreateInstance(__uuidof(ADOX::Column)));
m_pColumn->Name = name;
m_pColumn->Type = nType;
m_pColumn->DefinedSize = lSize;
m_pColumn->Attributes = ADOX::adColNullable;

m_Table->Columns->Append(m_pColumn->Name,nType,lSize);

//Get some properties
ADOX::PropertiesPtr pptr;
m_pColumn->get_Properties(&pptr);
long cnt = pptr->Count; //THIS RETURNS 0 !

Thanks,
Andy


This may or may not help. I often confuse myself when working with ADOX as
it appears to have the same model as ADO, but it is subtly different. So I
may be wrong, but I don't think "Column" has a property collection in
ADOX,
except for provider-specific properties. Your provider may not supply one.

To access existing declared properties (name, type, size, ...) I think you
have to read them one at a time. Just like you set them.


Should change "Your provider may not supply one." to "Your provider may not
supply any additional properties. ie, ADOX supplies the Collection, but it
may be empty."

-ralph


.



Relevant Pages

  • Re: ADOX - Access table creation with nullable columns.
    ... I can access the properties on the column object. ... I often confuse myself when working with ADOX as ... Should change "Your provider may not supply one." ...
    (microsoft.public.data.ado)
  • Re: Create access database on run time
    ... Certain features of ADOX are ... depending upon your OLE DB data provider. ... >> Server, the Microsoft OLE DB Provider for ODBC, or the Microsoft OLE ...
    (borland.public.delphi.database.ado)
  • Re: ADOX modify column Nullable
    ... Didrik Finne wrote: ... with an Access 97 database through ADOX (that is, ... ParentCatalog property might make a difference with Mark's example - ... The 2nd lists the Jet 4.0 specific provider properties. ...
    (microsoft.public.vb.database.ado)
  • Re: Create access database on run time
    ... but what is ADOX type library? ... depending upon your OLE DB data provider. ... Microsoft OLE DB Provider for SQL Server, the Microsoft OLE DB Provider for ... Microsoft OLE DB Provider for SQL Server ...
    (borland.public.delphi.database.ado)
  • Re: ADOX - Access table creation with nullable columns.
    ... property collection in ADOX, except for provider-specific properties. ... This email account is my spam trap so I ...
    (microsoft.public.data.ado)