How to use Database Toolbox to query ACCDB/MDB file programmatically without JDBC/ODBC bridge on Windows
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 29 de Mzo. de 2018
Editada: MathWorks Support Team
el 17 de Jun. de 2019
Starting R2017b, MATLAB Database Toolbox no longer supports JDBC/ODBC bridge because MATLAB starts using JRE version 8. How can I query ACCDB/MDB file on Windows with Database Toolbox?
Respuesta aceptada
MathWorks Support Team
el 18 de Jun. de 2019
Editada: MathWorks Support Team
el 17 de Jun. de 2019
Please consider adding/removing the ODBC data source using command line options in Windows. Please refer to the following page from Microsoft for commands such as 'odbcconf' in command prompt or 'Add-OdbcDsn' in PowerShell:
Since 'odbcconf' is not recommended by Microsoft, please find the following example of using '<https://www.mathworks.com/help/matlab/ref/system.html system>' command in MATLAB to execute PowerShell command 'Add-OdbcDsn' with the following:
>> dbqfilepath = strcat("'dbq=", filepath, "'");
>> dbsource = strcat("powershell;Add-OdbcDsn -Name 'dbdemo' -DriverName 'Microsoft Access Driver (*.mdb, *.accdb)' -DsnType 'User' -Platform '64-bit' -SetPropertyValue ", dbqfilepath);
>> system(dbsource);
The above would help adding the datasource to ODBC and you may then use '<https://www.mathworks.com/help/database/ug/database.html database>' command for native ODBC connection.
To remove the data source, please refer to the following page from Microsoft for the 'Remove-OdbcDsn' PowerShell command:
An example command would look like the following:
system("powershell;Remove-OdbcDsn -Name 'dbdemo' -DsnType 'User' -Platform '64-bit'");
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Database Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!