| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Database Toolbox |
| Contents | Index |
| Learn more about Database Toolbox |
d = getdatasources
d = getdatasources returns the names of valid ODBC and JDBC data sources on the system as a cell array d of strings. The function gets the names of ODBC data sources from the ODBC.INI file located in the folder returned by running:
myODBCdir = getenv('WINDIR')
d is empty when the ODBC.INI file is valid, but no data sources are defined. d equals -1 when the ODBC.INI file cannot be opened.
The function also retrieves the names of data sources that are in the system registry but not in the ODBC.INI file.
If you do not have write access to myODBCdir, the results of getdatasources may not include data sources that you recently added. In this case, specify a temporary, writable, output folder via the preference TempDirForRegistryOutput. For more information about this preference, see setdbprefs.
getdatasources gets the names of JDBC data sources from the file that you define using setdbprefs or the Define JDBC data sources dialog box.
Get the names of databases on your system.
d = getdatasources
d =
'MS Access Database' 'SampleDB' 'dbtoolboxdemo'
![]() | get | importedkeys | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |