Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: COM Objects - Changing Data Import Properties
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Kevin Ellis

Posts: 58
Registered: 11/29/10
COM Objects - Changing Data Import Properties
Posted: Jul 8, 2014 5:22 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello,

I have a question concerning COM Objects. I first create a Connection and open it using the following code:

Connection = actxserver('ADODB.Connection');
Connection.Open('Provider=NOTSHOWN;Server=NOTSHOWN;Database=NOTSHOWN;Trusted_Connection=NOTSHOWN;');

Then I execute a variety of SQL statements that are simple because I create views in the SQL Server database that I can query easily.

DataRecordSet = Connection.Execute(SQLStatementData);

For some reason, I always have to transpose the data to get things formatted correctly using something like this:

TempDataTable = DataRecordSet.GetRows';

Now my question is if there is any way to change the format of the data when I execute the SQL statement? TempDataTable is always in a cell array format (which is fine) but is there a way to maybe change it to a dataset (Statistics toolbox)? I can't seem to find any documentation on changing properties specifically. And yes I have been looking extensively on the mathworks website (http://www.mathworks.com/help/matlab/using-com-objects-in-matlab.html).

Lastly, I have been having trouble reading dates. Blank dates are always being read as NaN instead of just blank (''). I know that the database toolbox has a command called setdbprefs which allows you to change properties such as NullStringRead which is exactly what I want to do but using COM Objects. So, is there a way to change the way NULL data is being read between MatLab and SQL Server?

Any help would be much appreciated. Thanks.

Kevin



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.