Our application (already used) is applying an Access/Jet database. The approaching version in our software requires some additional posts within the tables. I have to first see if these posts exist, after which add them when they don't.
Can someone give a quick code sample, link, or nudge within the right direction?
(I am using c#, but a VB.Internet sample could be fine, too).
Off the top my mind, but something similar to:
Dim conn as New AdoConnection(someConnStr) Dim cmd as New AdoCommand cmd.Connection = conn cmd.CommandText = "ALTER TABLE X ADD COLUMN y COLUMNTYPE" cmd.ComandType = CommandType.Text cmd.ExecuteNonQuery()
Query the table for that area you anticipate and take care of the mistake when the area isn't there.
Too add the column, just feed the database an alter table SQL statement.