Which version of VB are you using?
I appreciate that this is C#, but it may help you:
string commandString = "ALTER TABLE " + TableName + " ADD COLUMN " + FieldName + " " + Type;
OleDbConnection Conn = new OleDbConnection( your connection );
Conn.Open();
OleDbCommand Command = new OleDbCommand(commandString, Conn);
Command.ExecuteNonQuery();
Where TableName, FieldName and Type are all strings. More about Type can be found here:
http://msdn.microsoft.com/en-us/library/ms714540(VS.85).aspx
You may like to add an exception handler around the .ExecuteNonQuery and handle it accordingly.
HTH
Enter your message below
Sign in or Join us (it's free).