LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I refer a reference?

Solved!
Go to solution

Hi,

 

I'm using the DAO (Data Access Object). My goal is two write/read in an Access Database.

 

Everything is good but I don't know how to refer a reference/pointer in Labview.

 

For example the Delphi code would be:

 

     curField := recordset.Fields[0].Value := 1;
curField := recordset.Fields[1].Value := 'First record';

The Labview Fileds looks like (ignorw variant VIs. I was only trying something):

 

lbv.jpg

 

I would like to access Fields[x].Value but I have no ideea how to do it. If I use Invoke Node or Property Node I have only 3 methods (Append, Refresh, Delete) and 1 property (Count).

 

So the questions: how can I access (or refer) in Labveiew the Fields[x].Value ???

 

Thanks,

Paul

0 Kudos
Message 1 of 9
(3,260 Views)

Hi,

 

I will try to explain my final goal.

 

I want to create an MS Access Database. I was able to open one, to create a table and fields (head of table), to read the fields, but I don't know how to write in a table.

 

I've read the msdn - DAO documentation, I've found some examples but everything is in Basic, C++, Delphi. In these programming languages it's easy, but I don't know how to translate some operators in LabView. As you can see in the previous post I need a refer operator for an object. I have the reference Fields and I want to access Fields(1).Value.

 

Maybe I'm on the wrong track. So if you have any suggestions please share them.

 

Thanks,

Paul

0 Kudos
Message 2 of 9
(3,213 Views)

Hi Paul,

what do you get if you connect a property node to the Fields reference? Is there any property available? If not, then you can try it like shown in the attached image. It's an example from Excel. There you can see how to get single elements.

 

Hope it helps.

Mike

0 Kudos
Message 3 of 9
(3,207 Views)

Hi Mike,

 

Thanks for your ansewer.

If I attach a property node I have only the property "Counts" and if I attach a invoke node I have only three methods: "Append", "Delete" and "Refresh".

 

Here is something from msdn - DAO documentation:

 

To refer to a Field object in a collection by its ordinal number or by its Name property setting, use any of the following syntax forms:

Fields(0)

Fields("name")

Fields![name]

With the same syntax forms, you can also refer to the Value property of a Field object that you create and append to a Fields collection. The context of the field reference will determine whether you are referring to the Field object or the Value property of the Field object.

 

Documentation for Fields object: msdn - Fields object domcumentation

 

Regards,

Paul

0 Kudos
Message 4 of 9
(3,191 Views)

Hi Paul,

in my version there is also a Item method. If you also can find it, then it should be possible like in the attached image.

 

Mike

 

Edit: sorry, forgot to connect the count output to the loop counter!

0 Kudos
Message 5 of 9
(3,186 Views)

Hi Mike,

 

Which DAO version are you using? Mine is 3.6 and I don't have Item property. (as you can see in attachment).

 

Can you please send to me (attache it) the small vi from which you made the screen-shot?

 

Thanks,

Paul

0 Kudos
Message 6 of 9
(3,172 Views)
Solution
Accepted by topic author PaulieQ

Hi Paul,

that's what i use.

 

Mike

Download All
Message 7 of 9
(3,166 Views)

Hi Mike,

 

I've copied the invoke node from your vi and it works. But the weird thing is that I'm only able to select those 3 methods (Append, Delete, Refresh). I only have to keep it like in your example and it works ( i cannot select Item method on my computer). It doesn't matter as long it works.

 

weird.png

 

Thank you very much for your support.

 

Paul

0 Kudos
Message 8 of 9
(3,151 Views)

Hi Paul,

sorry, i didn't know that the item property is "privat stuff". You should be able to select it, if you follow this link and insert the "supersecretprivatstuff" line in your LabVIEW.ini.

 

Mike

Message 9 of 9
(3,117 Views)