Change column name

  • Thread starter Thread starter Guy Cohen
  • Start date Start date
G

Guy Cohen

Hi all.

I have a table full with data.
I need to change a column name from X to Y.

How do I do that using VB6 + ADO.

TIA
Guy
 
I don't think it's possible using ADO. ADO is a data access method, and
things like field names aren't data: they're metadata.

It's trivial using DAO, though: simply assign a new value to the field's
name. Using Access, it would be something like:

CurrentDb().TableDefs("NameOfTable").Fields("X").Name = "Y"

I'm sure it's possible using ADOX, but I never bother using ADOX with Jet
databases (MDB files): it seems pointless, since it's better to use DAO with
Jet.
 
Back
Top