问题
Using C, I am trying to create an Access 2007 database file using ODBC by way of the SQLConfigDataSource function.
char szDriverName[] = "Microsoft Access Driver (*.mdb, *.accdb)";
char szAttr[] = "CREATE_DB=c:\access2007.accdb";
SQLConfigDataSource(NULL, ODBC_ADD_DSN, szDriverName, szAttr);
I want the file extension of the new database to be .accdb but when I run the code above, I always get c:\access2007.accdb.mdb. I can specify 12.x (accdb) or 4.x (mdb) from ODBC Admin as in the image below, but how do I do it via ODBC API?

I am able to create the User DSN, however I feel that it is also in the wrong format as I have not tested it.
How do I define the Format Version using ODBC/Access API?
回答1:
Use CREATE_DBV12:
char szDriverName[] = "Microsoft Access Driver (*.mdb, *.accdb)";
char szAttr[] = "CREATE_DBV12=c:\access2007.accdb";
SQLConfigDataSource(NULL, ODBC_ADD_DSN, szDriverName, szAttr);
来源:https://stackoverflow.com/questions/9205633/how-do-i-specify-the-odbc-access-driver-format-when-creating-the-database