Adding a column to a database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm having trouble adding a column to my database. I have tried the help
option in Access, but it doesn't give me the option to insert column. Can
someone please help?
 
I'm assuming this question is about adding a column programmatically, not
about adding a column manually via the user interface. One way to do it is
by executing a DDL (Data Definition Language) SQL statement ...

CurrentProject.Connection.Execute _
"ALTER TABLE Categories ADD COLUMN MyNewColumn int"

You can also do it via DAO or ADOX, if you prefer. For DAO, see the
CreateField method of the TableDef object. For ADOX ... um, well, for ADOX
you'd best ask someone else, I'm not really familiar enough with ADOX to
advise you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top