MATLAB "JoinTwoDatabaseTablesExample" Error
    1 Ansicht (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    ILoveMATLAB
      
 am 17 Mai 2021
  
    
    
    
    
    Beantwortet: Adam Danz
    
      
 am 17 Mai 2021
            Matalb throws an error when running the following the "JoinTwoDatabaseTablesExample". What am I missing?
Step 1: Open Join Two Databse Table Example
openExample('database/JoinTwoDatabaseTablesExample')
Step 2: Run first section of Code
%% Join Two Database Tables
% Use an ODBC connection to import product data from an inner join between
% two Microsoft(R) SQL Server(R) database tables into MATLAB(R). 
%%
% Create an ODBC database connection to a Microsoft SQL Server database
% with Windows(R) authentication. Specify a blank user name and password.
% The database contains the tables |productTable| and |suppliers|.
datasource = 'MS SQL Server Auth';
conn = database(datasource,'','');
Step 3: MATLAB throws the following error message.
Error using database (line 59)
Unable to access data source name. Use databaseConnectionOptions to create a data source. Use
configureODBCDataSource to create an ODBC data source.
Error in JoinTwoDatabaseTablesExample (line 10)
conn = database(datasource,'','');
0 Kommentare
Akzeptierte Antwort
  Adam Danz
    
      
 am 17 Mai 2021
        There are several steps needed to set up a data source and connect to Microsoft SQL Server database or Azure Synapse SQL.  
They are explained here
You'll see at step #3 in the first link that the line you're executing assumes that you are connecting to a data source named MS SQL Server Auth.  
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
				Mehr zu Database Toolbox finden Sie in Help Center und File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

