WICHTIG: Der Betrieb von goMatlab.de wird privat finanziert fortgesetzt. - Mehr Infos...

Mein MATLAB Forum - goMatlab.de

Mein MATLAB Forum

 
Gast > Registrieren       Autologin?   

Partner:




Forum
      Option
[Erweitert]
  • Diese Seite per Mail weiterempfehlen
     


Gehe zu:  
Neues Thema eröffnen Neue Antwort erstellen

import Daten from Ms Access to Matlab

 

samad
Forum-Anfänger

Forum-Anfänger


Beiträge: 28
Anmeldedatum: 01.03.10
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 18.07.2011, 15:50     Titel: import Daten from Ms Access to Matlab
  Antworten mit Zitat      
Hi. i just want to open a .mdb access file in matlab and then do some data analyse. this file is in my Drive c:matlab\sample\access\Datenbank2.mdb

hier is the code i want to use:

Code:
function out = ImportMsAccessData(Datenbank2, Tabelle1)
% Takes in an MS Access Database name and table name and returns a dataset
s=['PROVIDER=MSDASQL;'];
s=[s 'DRIVER=fMicrosoft Access Driver (*.mdb)g;'];
s=[s 'DBQ=' Datenbank2 ';'];
% Timeout if connection to DB can't be made in 60s
try
cn=COM.OWC11_DataSourceControl_11;
catch
cn=COM.OWC10_DataSourceControl_10;
end
cn.ConnectionString=s;
cn.Connection.CommandTimeout=60;
cn.RecordsetType=1;
% Limit rows returned to 20,000
sql=strcat('select top 200000 * from', Tabelle1);
r = cn.connection.invoke('execute', sql);
if r.state && r.recordcount>0
x=invoke(r,'getrows');
x=x';
else
x=[];
end
invoke(r,'release');
out = x;


but i think this code is to connecting with a server. How or where can i write the file address in this code?????

Do u have any idea how i open such files and transfer the data in matlab???

some other codes?????


thankx.


Edit by Martin: Bitte Code-Formatierung verwenden. Danke!
Private Nachricht senden Benutzer-Profile anzeigen


Neues Thema eröffnen Neue Antwort erstellen



Einstellungen und Berechtigungen
Beiträge der letzten Zeit anzeigen:

Du kannst Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum antworten.
Du kannst deine Beiträge in diesem Forum nicht bearbeiten.
Du kannst deine Beiträge in diesem Forum nicht löschen.
Du kannst an Umfragen in diesem Forum nicht mitmachen.
Du kannst Dateien in diesem Forum posten
Du kannst Dateien in diesem Forum herunterladen
.





 Impressum  | Nutzungsbedingungen  | Datenschutz | FAQ | goMatlab RSS Button RSS

Hosted by:


Copyright © 2007 - 2025 goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks

MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.