Parsing the Ms access data base
Show older comments
I have a database with two tables. I tried to extract the data from the tables and i was able to extract also using the command below,
rs=invoke(hopen,'OpenRecordset','Data');
fieldlist=get(rs,'Fields');
ncols=get(fieldlist,'Count');
for c=1:double(ncols)
fields{c} = get(fieldlist,'Item',c-1);
resultset.columnnames{c} = get(fields{c},'Name');
end;
nrecs=0;
while get(rs,'EOF') == 0
nrecs = nrecs + 1;
for c=1:ncols
resultset.data{nrecs,c} = get(fields{c},'Value');
end;
invoke(rs,'MoveNext');
end
Only problem is when I have a multiple values in the cell i can able to extract only first element in the cell.
For example,

in the above figure, the column carsSelected consists of multiple value in the cell. In this case i cannot able to extract all the elements in the cell? How can I do this?
Thanks a lot
4 Comments
Guillaume
on 28 Mar 2017
As far as I know you cannot have multiple values in a column of a single record (what you call cell). So, what is the type of that CarsSelected column, and isn't that 1;2;3;4 drop down simply a string (which your code should retrieve in its entirety).
If you can, attach your database.
Gopalakrishnan venkatesan
on 28 Mar 2017
Edited: Gopalakrishnan venkatesan
on 28 Mar 2017
Guillaume
on 28 Mar 2017
Can you show the design view of that Color table?
Gopalakrishnan venkatesan
on 28 Mar 2017
Accepted Answer
More Answers (0)
Categories
Find more on Cell Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

