LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to creat a DAO invoke node of index method like workspaces[0] (C language)

I want to use DAO to access MS Access database file. I can creat DBEngine and workspaces, but when I want to create a invoke node of index method like workspaces(0) in C language, I can't find this method, it only display methods "append, delete, refresh". Then I find a document "What Is the Function of the Property and Invoke Nodes in LabVIEW?" from NI website. Unfortunately I don't understand "Some objects may not have exposed methods. The correct inputs will be added to the Invoke Node for a chosen method". So I think index method is a correct mehod and maybe not a exposed method, but who can tell me how to correct input the method. Thanks. Attach a scree snap to explain what I hav
e done and what I need.
0 Kudos
Message 1 of 4
(2,845 Views)
I am not familiar with DAO, but I have used ActiveX in LV many times in the past. The problem is that the creaters of ActiveX controls have to write extra code so that the methods/properties will appear in LabVIEW. This is not to say that the code is specifically for LabVIEW--it is just that other languages like VB do not need the code to allow the user to use the method. The VB user can just write in the name of the property or method and go. A LabVIEW programmer is out of luck because LV needs this type description to fill in the list for the property node. To my knowledge there is no way to use a method/property in LabVIEW without it showing up on the method/property list.

Many times when a method or property is not what you think it should be,
it is because you are using the wrong reference. MS Word is a good example of this. You can open Word but you cannot do anything untill you create a document. The document reference is then used to supply it's own properties and methods. You will need to look into using properties that output references which can then be used for what you want to do.

LabVIEW also allows the user to have activeX containers and automation reference. The containers are usually for activex controls but there is no hard rule for what activex object you use with what LabVIEW control (activeX container or automation reference). If you cannot find what you need with one of the LV controls, try the other.

Finally for any activeX LV program, I recommend looking on the web for an existing VB code. Usually it is a simple matter to convert the VB calls into LabVIEW. This will save you hours of work.
0 Kudos
Message 2 of 4
(2,845 Views)
First, thank for your answer. In fact I download a example code of display table of MS Access via DAO from NI Development Zone. And this vi is run properly in my PC. So I think the code is correct. The strange thing is NI engineer can write the code, not I. I want to rewrite the code by myself to understand it. I met the problem when I want to create the first invoke node same with the code. Pls refer attachment. Pls see the first invoke node in the vi, it's a "workspaces" with method "Item", but when you use shortcut menu on it, it only display "Append, Delete, Refresh", no "Item". Who wrote the code? How he write the code?Why he can write, but I can't? Thanks.
0 Kudos
Message 3 of 4
(2,845 Views)
I understand better. I suspect what has happened is that the control has changed over time. In the past item was an exposed option but now it is not. I recommend digging through msdn.microsoft.com for information on the DAO version you are using. It is going to be work, but I recommend getting an understanding of the current DAO. This will allow you to adapt existing code more easily. Below you will find two links to get you started on the MSDN.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbegvb/html/universaldataaccess.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_dao_workspace.asp
0 Kudos
Message 4 of 4
(2,845 Views)