tdf#97978: add support for opening mde and accde files in base

This patch modifies the base 'open existing database' wizard so accde and mde files
can be chosen as targets for access and access 2007 databases. Both file types are
the runtime-only equivalents to accdb and mdb files so base can use them in the
same way as does with the former

Change-Id: I5b6002089a2d3c19498ff6e05bae3facc5a4e2d0
Reviewed-on: https://gerrit.libreoffice.org/22957
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
pasqualm 2016-03-06 20:44:01 +01:00 committed by Noel Grandin
parent 221144f9c9
commit a6ca4ec7f5
3 changed files with 8 additions and 8 deletions

View File

@ -230,7 +230,7 @@ namespace dbaui
break;
case ::dbaccess::DST_MSACCESS:
{
const OUString sExt("*.mdb");
const OUString sExt("*.mdb;*.mde");
OUString sFilterName(ModuleRes (STR_MSACCESS_FILTERNAME));
::sfx2::FileDialogHelper aFileDlg(
ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
@ -242,7 +242,7 @@ namespace dbaui
break;
case ::dbaccess::DST_MSACCESS_2007:
{
const OUString sAccdb("*.accdb");
const OUString sAccdb("*.accdb;*.accde");
OUString sFilterName2(ModuleRes (STR_MSACCESS_2007_FILTERNAME));
::sfx2::FileDialogHelper aFileDlg(
ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,

View File

@ -78,11 +78,11 @@ String STR_FILTER_CSV
};
String STR_FILTER_MDB
{
Text [ en-US ] = "Microsoft Access (*.mdb)" ;
Text [ en-US ] = "Microsoft Access (*.mdb;*.mde)" ;
};
String STR_FILTER_ACCDB
{
Text [ en-US ] = "Microsoft Access 2007 (*.accdb)" ;
Text [ en-US ] = "Microsoft Access 2007 (*.accdb,*.accde)" ;
};
String ST_SAVESTART

View File

@ -2634,8 +2634,8 @@ OUString SwDBManager::LoadAndRegisterDataSource(SwDocShell* pDocShell)
xFltMgr->appendFilter( sFilterTXT, "*.txt" );
xFltMgr->appendFilter( sFilterCSV, "*.csv" );
#ifdef _WIN32
xFltMgr->appendFilter( sFilterMDB, "*.mdb" );
xFltMgr->appendFilter( sFilterACCDB, "*.accdb" );
xFltMgr->appendFilter(sFilterMDB, "*.mdb;*.mde");
xFltMgr->appendFilter(sFilterACCDB, "*.accdb;*.accde");
#endif
xFltMgr->setCurrentFilter( sFilterAll ) ;
@ -2698,14 +2698,14 @@ SwDBManager::DBConnURITypes SwDBManager::GetDBunoURI(const OUString &rURI, uno::
type = DBCONN_FLAT;
}
#ifdef _WIN32
else if(sExt.equalsIgnoreAsciiCase("mdb"))
else if (sExt.equalsIgnoreAsciiCase("mdb") || sExt.equalsIgnoreAsciiCase("mde"))
{
OUString sDBURL("sdbc:ado:access:PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=");
sDBURL += aURL.PathToFileName();
aURLAny <<= sDBURL;
type = DBCONN_MSJET;
}
else if(sExt.equalsIgnoreAsciiCase("accdb"))
else if (sExt.equalsIgnoreAsciiCase("accdb") || sExt.equalsIgnoreAsciiCase("accde"))
{
OUString sDBURL("sdbc:ado:PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=");
sDBURL += aURL.PathToFileName();