Question: I am currently writing a mdb Migration script in Java. This is noting but adding and modifying some of the column names in the MDB file.

I created new tables and thats not a problem but I could not find a query to Alter the name of the column

Lets say I have table named Employees having columns as "ID", "EName", "Active?" Now I want to change the column name "Active?" to "Active" (i.e. without question mark.) 

How this can be done using JDBC java.
THanks

Answer: 
One way to accomplish your goal would be to save the following VBScript code as `RenameColumn.vbs`...

```vbs
Option Explicit

Dim objArgs, dbPath, tblName, oldColName, newColName
Dim dbe  ' As DAO.DBEngine
Dim db   ' As DAO.Database
Dim fld  ' As DAO.Field

Set objArgs = WScript.Arguments
dbPath = objArgs(0)
tblName = objArgs(1)
oldColName = objArgs(2)
newColName = objArgs(3)

Set dbe = CreateObject("DAO.DBEngine.120")
Set db = dbe.OpenDatabase(dbPath)
Set fld = db.TableDefs(tblName).Fields(oldColName)
fld.Name = newColName
Set fld = Nothing
Set db = Nothing
Set dbe = Nothing

```

...and then your Java program could invoke it using code something like this:

```
import java.io.*;

public class RenameColumns {

    public static void main(String[] args) {
        String dbPath = "C:\\__tmp\\Database1.accdb";
        String tblName = "Employees";
        String oldColName = "Active?";
        String newColName = "Active";

        String cmd = 
                "cscript C:\\__tmp\\RenameColumn.vbs"
                    + " \"" + dbPath + "\""
                    + " \"" + tblName + "\""
                    + " \"" + oldColName + "\""
                    + " \"" + newColName + "\"";
        try {
            Process p = Runtime.getRuntime().exec(cmd);
            p.waitFor();
            BufferedReader rdr = 
                    new BufferedReader(new InputStreamReader(p.getErrorStream()));
            int errorLines = 0;
            String line = rdr.readLine();
            while (line != null) {
                errorLines++;
                System.out.println(line);  // display error line(s), if any
                line = rdr.readLine();
            }
            if (errorLines == 0) {
                System.out.println("The operation completed successfully.");
            }
        } catch(Exception e) {
            e.printStackTrace();
        }
    }

}

```
Seems MS A[ccess does not allow](http://msdn.microsoft.com/en-us/library/office/bb177883%28v=office.12%29.aspx) the renaming of the columns(*reference links* [1](https://stackoverflow.com/questions/2049245/what-is-the-ddl-to-rename-column-in-msaccess),[2](http://www.access-programmers.co.uk/forums/showthread.php?t=90736)). Only way forward is, 

* Backup your data in a different table
* Drop the column
* Add a column with new name
* Populate the table from the backed up table.