LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MS Access & OLE Object as Datatype

Hello,
 
I am using LabVIEW & MS Access.
 
My  connection between the two works well and I am getting data inserted.
 
Issue: The data type in access for the numbers that is supposed to be represented comes out as OLE Object.
 
I have changed it to Numbers but it erases my data completely.
 
I have attached image to show what I am encountering.
 
Thanks.
0 Kudos
Message 1 of 11
(5,332 Views)
Hi Robo:
OLE object data can not be displayed in Access. As it is binary, you would only see trash. For example, something like this for a 10 elements array:

?ë.‹âôí?å;oo¦[þ?磻af?è c2ãìÌ?Õ|•ú/%è?ç’H1Í×
Aitortxo.
Message 2 of 11
(5,318 Views)

How would I get it from LabVIEW?

Is there no way to see the numbers in Access?

I have already created a subvi that can generate the numbers I want from my data but I want it the database.

Thanks.

0 Kudos
Message 3 of 11
(5,310 Views)
Hi, Robo:

You can get (select) the data as you do with other kind of data with "DB Tools Select Data" function, and then with "Database Variant to Data" convert it to the type of data you inserted.

Hope it helps,
Aitortxo.
Message 4 of 11
(5,282 Views)

Hello,

Will you show me an example of what you suggested above.

Thanks!

0 Kudos
Message 5 of 11
(5,274 Views)
Sure Robo:

Here it is:

Pre-requisites:
an empty Access DB
a DSN File connection to the Access DB

1.- Generate an XY Graph in a FOR loop.
2a.- Open DB
2b.- Create a sample Table with one OLE Data Column
* if you try to run this VI again it will fail, as the table exists and can't be created again
2c.- Insert XY Graph as it is into DB.

3.- Retrieve OLE Data from DB (just as any other data type)

4.- Convert OLE Data to something readable
4a.- "DB Tools Select Data" will retrieve (if we don't add optional clauses) all rows of the table in a 2D Variant Array, so we get the first element.
4b.- Any element of that 2D Variant array will be an XY Graph, as we know, because we have inserted an XY Graph. So now we can convert it back to XY Graph using "DataBase Variant to Data" function.

5.- If we make an XY Graph with the data we recovered, the results are the same.

6.- Finally, close the DataBase.

Hope it helps,
Aitortxo.
Message 6 of 11
(5,265 Views)

Hello,

What you suggested was very useful.

But it does not allow me to insert numbers like I want in the database.  That has always been my original goal.  I have the DBC Toolset and I have tried wha you have suggested but the issue is getting my numbers generated in LabVIEW into the Access database.

If you have any suggestions or ideas, it is appreciated. 

Thanks for all your help.

0 Kudos
Message 7 of 11
(5,247 Views)
Hi Robo:

'But it does not allow me to insert numbers like I want in the database'

I don't understand you very well.

1.- The problem can be how to insert and retrieve OLE data to a Database
The VI I attatched can be used to do the job.

2.- The problem can be how to see OLE data directly in Access
It is impossible, as Access just tells you that it is an Ole Object, but nothing else.

Please, if your problem is something else, reply to post.

hope it helps,
Aitortxo.
Message 8 of 11
(5,238 Views)

Hello,

Is there a way that I can e-mail you.

Thanks.

 

0 Kudos
Message 9 of 11
(5,235 Views)
Hi Robo:

I think that asking for Email is not a good option in forums.I hope you can post your comments, I and others will be glad to answer
Aitortxo.
Message 10 of 11
(5,230 Views)