Rank: 19136 based on downloads (last 30 days) and 0 files submitted
photo

Guyennon Nicolas

E-mail

Personal Profile:

Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Guyennon
Updated File Comments Rating
24 Feb 2009 ADO OLE Database Connection Queries datasource and insers data into datasource. Author: Martin Furlan

Thanks a lot !!! Amazing work, even faster than Tim Myers code (oledb*.m)
I'm working with your toolbox to query access 2003 database.
I was looking for table, field and query information. Tooks me 4 days ... hope that could help someone else

%% get table name
sqltablename='SELECT name FROM MSysObjects WHERE Type=1 AND Flags=0 ORDER BY name';
tablename=adodbquery(cn,sqltablename);
%% get query name
sqlqueryname='SELECT name FROM MSysObjects WHERE Type=5 AND Flags=0 ORDER BY name';
queryname=adodbquery(cn,sqlqueryname);

note that in both case you should first change users authorization to read for MSysObjects opening your access database. ("user and group authorization" menu in tools)

the hardest part was to get fields or columns name ...

function field_name=tablefieldname(cn,table_name)
%% find all field name from table
sqlfiledname=['SELECT * FROM ' table_name];
invoke(cn,'BeginTrans');
r = invoke(cn,'Execute',sqlfiledname);
invoke(cn,'CommitTrans');
nbfileds=r.Fields.count;field_name='';
for ff=1:nbfileds
    fld=r.Fields.Item(ff-1);
    field_name=strvcat(field_name,fld.name);
end

bye
Nico

 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com