The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

Advanced Search

Back to Topic List Back to Topic List  
Kevin Ellis

Posts: 62
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


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

Connection = actxserver('ADODB.Connection');

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 (

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.


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.