Using ADO you can
loCon.Execute "ALTER TABLE Table2 ADD COLUMN [Val1] varchar(50)"
loCon.Connection.Execute "UPDATE Table2 SET [Val1] = [Value]"
loCon.Connection.Execute "ALTER TABLE Table2 DROP COLUMN [Value]"
Where loCon is you connection object.
Alternatively create a reference to ADOX and then use that to create the
column instead of line 1 above (best done if this is going to be generic as
you can then replicate the attributes of the source field to the target
field).
--
Terry Kreft
"Alan Mailer" <clarityassoc@earthlink.netwrote in message
news:v36og2to38jeulki53clsdukd3pckpprv9@4ax.com...
Quote:
I'm sorry if this one has been asked and answered a million times:
>
Is it possible to have a VB6 app alter the name of an *existing* field
in Access 2002 database? To be clear, I'm not talking about adding a
new field to the Access database. I want to change the name of an
*existing* field using a VB6 app.
>
What type of VB6 code would you use to do this? And please, if your
suggestion involves using Project References other than "Microsoft
Access 10.0 Object Library" and "Microsoft ActiveX Data Objects 2.7
Library", please specify which References I would need to add to the
Project to accommodate your suggestion.
>
I really appreciate your help.