- case dbmsSYBASE_ASA :
- case dbmsSYBASE_ASE :
- case dbmsMY_SQL :
- case dbmsPOSTGRES :
- case dbmsACCESS :
- case dbmsDBASE :
- default :
- alterSlashModify = "MODIFY";
- break;
- }
-
- // create the SQL statement
- sqlStmt.Printf(wxT("ALTER TABLE %s %s %s %s"), tableName.c_str(), alterSlashModify.c_str(),
- columnName.c_str(), dataTypeName.c_str());
+ }
+
+ // Set the modify or alter syntax depending on the type of database connected to
+ switch (Dbms())
+ {
+ case dbmsORACLE :
+ alterSlashModify = "MODIFY";
+ break;
+ case dbmsMS_SQL_SERVER :
+ alterSlashModify = "ALTER COLUMN";
+ break;
+ case dbmsUNIDENTIFIED :
+ return FALSE;
+ case dbmsSYBASE_ASA :
+ case dbmsSYBASE_ASE :
+ case dbmsMY_SQL :
+ case dbmsPOSTGRES :
+ case dbmsACCESS :
+ case dbmsDBASE :
+ case dbmsXBASE_SEQUITER :
+ default :
+ alterSlashModify = "MODIFY";
+ break;
+ }
+
+ // create the SQL statement
+ if ( Dbms() == dbmsMY_SQL )
+ {
+ sqlStmt.Printf(wxT("ALTER TABLE %s %s %s %s"), tableName.c_str(), alterSlashModify.c_str(),
+ columnName.c_str(), dataTypeName.c_str());
+ }
+ else
+ {
+ sqlStmt.Printf(wxT("ALTER TABLE \"%s\" \"%s\" \"%s\" %s"), tableName.c_str(), alterSlashModify.c_str(),
+ columnName.c_str(), dataTypeName.c_str());
+ }