Open Access from Labview
Hi, I open a Access database with the metod Opencurrentdatabase of
appliaction.But i had a problem because the database open but after
it's closed.
What's is the right method for call a database?
Hello,
The preferred method of database communication with LabVIEW is the Database Connectivity Toolkit. Here is a link that may help you find more information about this. Also, you may want to look into some examples that have shipped with LabVIEW. They are found under "..LabVIEW\examples\comm\access.llb"
Jeremy L
National Instruments
Jeremy L.
National Instruments
Similar Messages
-
How to create a table in MS Access from Labview using ActiveX?
I want to transfer datas from Labview to Access using activeX method. My only problem is to find out how to create a new table (array) in Access from the Labview program.
Remarks: I use Labview 6i and MS Access 2000.
For the moment I can write and read datas of Access from Labview.
If someone could help me... that would be grate!This is off the Microsoft MSDN site "creating an external table". I think you can drop the last step.:
Open the database you want to create the table in. If it is the current database, use the CurrentDb function to return an object variable that represents the current database. If it isn�t the current database, use the OpenDatabase method to open the database you want.
Use the CurrentDb function to create a Database object that points to the current database.
Use the CreateTableDef method of the Database object to create a table definition for the Microsoft Access table.
Use the CreateField method of the TableDef object to create one or more fields in the Microsoft Access table.
Use the Append method of the Fields collection to add the new field or fields t
o the Microsoft Access table.
Use the Append method of the TableDefs collection to create the Microsoft Access table.
Use the TransferDatabase method to create the external table in the specified folder.
Use the Delete method of the TableDefs collection to delete the Microsoft Access table definition. -
Add records in table ACCESS from labview by ActiveX
I try to add records in table of database ACCESS by an ActiveX from labview but my programme doesn't work ...
What is the problem ?
I have attached my VI
Thanks in advance
hasna
Attachments:
base1.vi 35 KBOn Thu, 11 Jul 2002 08:13:48 -0700 (PDT), Lab Viewer
wrote:
>I saw your previous posts related to ActiveX/Access. I once had the
>same kind of problems. It's not an easy task (without a toolkit)
>because you have to learn the "interface" provided by Access/DAO in
>order to manage what you are trying to do.
>In my case, the best solution it was to follow the Visual Basic for
>Applications examples included in MS Access. Even though you don't
>know VB, don't be afraid. Important is to figure out from that example
>what methods/properties you need to use, the proper order to call them
>and eventually some parameters. You are dealing with the same
>methods/properties in LabVIEW, the difference is that you have them in
>a graphical format instead of text
.You can find these examples by
>going to MS Access help > Index and type DAO objects and then choose
>one to start with (Database, recordset, field =85).
>
>Hope this helps
The examples on NI's website were originally written using the DAO
model, but the latest one was written using the ADO model.
However, I am unable to find either example LLBs on their website
anymore. Maybe they're trying to push their SQL Toolkit.
Along with the VBA help in MS Access, I *highly* recommend the book
ADO Programming for Dummies. Wonderful book. Helped me understand the
VBA help. :-)
Again, if anyone is intersted in VIs using ActiveX that works. He/she
is welcome to email me.
Linda -
Error -2146960888 when opening excel from labview using active x
attempting to open an instance of excel from labview using active x, I even tried using the "open excel and make visible.vi" found on this site. I get errors every time, Inserting a break right after the property node, I found that it does open excel with no active workbook. once the program runs to ompletion excel terminates. The error is on the line right after the property node executes.
http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3F15456A4E034080020E74861&p_node=DZ53003&p_submitted=N&p_rank=&p_answer=&p_source=External
Attachments:
XL97table.zip 29 KB -
I want to open documents from one aplication made up with LabVIEW. The documents can be Word, Pdf, Excel and so on.
Coes anybody know how do this?
ThanksHi Miguel
Perhaps when trying to open a word doc you will get an empty word.
If so, modifie the vi as in attached doc to change /n option for an empty string.
In this way, word will open whit your document on screen.
saludos
Alipio
"Qod natura non dat, Salmantica non praestat"
Attachments:
Worddoc.doc 44 KB -
Write data on database ACCESS from labview
Hi!
I want to write on a table of database from labview... I have already succeeded in opening the base and the table but I don't know how write on it... I know that I must use
with Table
.Addnew
Table.Fields(0)=what I want to write
.update
end with
But how do it with labview ???
Thanks in advance
hasna
Attachments:
lecture_de_la_base.vi 35 KBHi Kiki,
I believe you have another Developer Exchange Forum open for this issue. To keep them similar, I am attaching an updated version of your VI. It is wired to read any errors which occur in the VI. I received error -2147221164. This does not help too much, because the meaning of this error depends upon the ActiveX server. You will want to run this VI yourself, see which error you get, and then consult the ActiveX Server documentation to find the meaning of the error.
J.R. Allen
Attachments:
criture_de_la_base.vi 37 KB -
How is possible open a file from labview?
You can use the Open File VI in the Advanced File Functions Menu. But
if what your trying to do is to open an Application, then you will
have to make use of the ActiveX possibilities in LabVIEW. If you need
more specific information in how to do this, I'd recommend you to give
more details on what you want to do exactly.
Cheers
Mamian -
How can I control a base ACCESS from labview ?
Hi,
I'm working on a projet on labview and ACCESS and I want to say how can I do to control a database from labview ???
Thanks in advance
Cordially,
HasnaOn Tue, 9 Jul 2002 02:50:12 -0700 (PDT), kiki wrote:
>could you give me more informations about Database Connectivity
>Toolset ???
>
>I notice that we can write data in excel file thanks to an ActiveX but
>is it possible with a table ACCESS ??
DCT it's a suite of VIs (I think Optionals) the contains anything you
need to connect to to a DB.
I used them with access... since I'm not really happy with performance
(read/write max 50 records/sec) it's quite quick to develop
applications that read/write DB.
(Write a Cluster it's trivial.... plug the cluster, prepare a table
with fields of the same type and the same order, yo've did it)
I think you can also use ActiveX, but I've never did. -
Can I launch MS Access from labVIEW?
I would like to programmatically lauch MS Access and compact a database. Or perhaps I could set the table to compact on exit and exit it programmatically through labVIEW. Can I launch and exit a Microsoft application using labVIEW?
Yes, you can use ActiveX for that, to start, you should place an Automation open in the diagram, select activeX class (Access application) and from there, follow wiring property and invoke nodes to do almost anything with Access.
Hope this helps -
Hey all,
I am trying to figure out how to open an Excel document from within a running LabView .vi. I have been looking around here but I can't seem to find exactly what I am looking for. What I have is a GUI running to operate some test equipment. The user needs to be able to create and load a configuration file that is created with Excel. I have added options to my Run Time Menu to make this easy for the user, but I can't figure out how to actually execute it in the code.
I plan on having the template they will use at a location like this:
C:\Program Files\Naitonal Instruments\LabView 8.2\Templates\Interrogation Setup.xls
So I am trying to figure out the best way to execute this. I was going to use the System Exec.vi but, being a DOS prompt, it can't handle the spaces in the directory. Is there a better way for me to do this?
Really appreciate it.You can interface excel via ActiveX in LabView. Have a search through the forum with these keywords. There is also a thread containing links to excel related threads, but I've no bookmark at hand.
Felix
www.aescusoft.de
My latest community nugget on producer/consumer design
My current blog: A journey through uml -
How to print a report in MS-Access from Labview?
Good morning,
We have our system running properly but we want to provide the user just one GUI to execute the measurements and print the report, we keep using ms-access beacuse facilitate the data integration with the res of the areas of tha company.
Thanks,
MiguelBasically, you are going to have to communicate with Access via ActiveX and tell it to print the report for you. If you don't know the Access object model a good approach is to find an example on how to programatically run a report in some easy to read text language like VB. While you will not want to follow the exact program structure too closely, it will at least tell you what properties and methods you will need to use.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps -
Problem of security using ADO from Labview to connect to Access 2000 Data Base
I have a problem using ADO from Labview to connect to Access 2000 Data Base.
First I open a ADO_DB_Engine and create a Workspace as an ODBCDirect. After I execute the open_data_base using the workspace. Here you can specify the parameter connect with /type of connection / user / password.
The problem is the following:
Although you configure a password for the Administrator user in Access, you can read/writte to data base from Labview using ADO without any security and without putting the user and password in the parameter connect. I need to access with security to data base using users and permissions but it seems that the parameter connect does not operate.
I attach
you a example of the vis and database. Remember create a ODBC connect with BD3.mdb
Thanks a lot
Peter Mst
Attachments:
SECURITY.zip 70 KB
BD3.mdb 112 KBHi Kahn,
If you use ADODB_connection -> Connection.Open and set in connection string :
"Provider=Microsoft.Jet.OLEDB.4.0; Jet OLEDBystem Database=c:\.....\Protegida5.mdw; Password=pepe;user ID=jose; Data Source:c:\......\BD5.mdb";
and after connection.execute ->
INSERT INTO tabla1 VALUES (5,'XXX'
you will be able to access to the database with security using the provider=Microsoft.Jet.OLEDB.4.0. With this provider you have to use the path and the name of the database file c:\.....\mdb file. From this way the problem is solved. (SEE SAMPLE_ADO_W2_JET.VI).
BD5.mdb have the following administrator user: user:jose / passwordepe (Protegida5.mdw)
The problem is when you want to
use ODBC and DSN. The name of this ODBC Provider is MSDASQL;. If you use this type of connection you can not enter to the database I attach you.
This database has a new administrator owner. I deleted the default administrator. If you support the default administrator you can connect to database by ODBC / DSN but the security disappear because you can always enter to database with any password, user o PC.
FINALLY I HAVE 3 QUESTIONS FOR Application Engineers of National Instruments or someone who knows these subjects before deciding the best way to connect locally o remotely with security to Access from Labview:
1.- Is it possible to enter to Database BD5.mdb from ODBC and DSN with this owner?
2.- I want to connect remotely to Access database too. Is it possible to use Microsoft.Jet.OLEDB.4.0 using the path (.mdb file) without DSN?
3. Which is the optimal Provider for Microsoft Access?
I thank you beforehand for your technical support.
Peter Mst.
Attachments:
BD5.mdb 116 KB
Protegida5.mdw 112 KB
sample_ADO_W2_JET.vi 45 KB -
What is the easiest way to open an application from Labview?
I need to open an application from labview and depending on a user's selection, load one out of a group of files for the application that is opened. I need to know what is the best or easiest way to open an application and load a file that is used by the application based on a selection.
Here is the response that I got from Cognex when I asked them about how to do this. Do you understand what they are talking about?
In order to do something like this you will probably want to look into the Display Control/SDK for In-Sight. The Display Control gets installed along with In-Sight Explorer and includes a control that can be used in an environment like Labview to communicate with In-Sight sensors while the SDK is an enhanced version of the Display Control that gives you more control and functionality. I am not very familiar with the Labview environment so I will give some code snippets in VB.Net and hopefully you can adjust them as necessary. Specifically I see 3 possible avenues to do this:
1) Using the Display Control you have access to many of the dialog boxes that are used in In-Sight Explorer including the Load Job dialog box. You can spawn this dialog box through a line of code similar to cvsInSightDisplay1.Edit.OpenJob.Execute(). I am not certain if the Labview environment will be able to spawn and display this dialog though. 2) With the addition of the SDK (additional purchase) you can directly access sensor properties including the job. There is a method called LoadJobFile to load jobs from on the sensor and LoadJobFileLocally to load jobs from the host machine. A typical line of code might be cvsInSightDisplay1.InSight.File.LoadJobFile("myjob1.job").3) If Labview cannot handle the dialogs and the SDK is not an option for you then you may still be able to do this using Native Mode commands. Native Mode commands are sent through a socket on the telnet port (typically port 23). Keep in mind that you will need to handle the username/password prompt and response when you first open the socket before issuing any Native Mode commands. The command to load a job file from the sensor would be the Load File command which would be a string similar to "LF myjob1.job". The Native Mode commands are documented in the In-Sight Explorer help file. -
Can I open a excel file from labview
I have a program who write temperature in a excel file and i want to open this file from labview .
This depends slightly on the amount of data you have stored within Excel.
You can use the "Labview Functions>>FileIO>>Read from Spreadsheet file.vi" which effectively reads all lines from a text file and converts it into a numeric array.
Alternatively, if your data structure in Excel is more complex than this, you can use ActiveX calls to Excel to retrieve it.
Use an "ActiveX>>Automation Refnum" control and select the Excel server class. This will then enable you to access properties and methods of Excel to retrieve data from specific cells and pages.
The attached example should help.
Dan
Attachments:
Excel_Automation.vi 60 KB -
How do I access open tabs from other devices in Firefox 4 for desktop (windows version)
I want to see the open tabs from other devices but I can't find how to access it.
Where do I find them in firefox 4?
I use the windows version.
Thank you!This is for all versions (image attached below):
1. In the top navigation (you might have to press the ALT key to reveal the menu), navigate to '''History - Tabs From Other Computers'''
2. Alternatively; open a new tab and type '''about:sync-tabs''' then press enter.
NB: When you open a tab in the 'Tabs From Other Computers' window it '''WILL NOT''' remove that tab from the other device.
Maybe you are looking for
-
Why won't my iMessage activate again?
My Imessage has been acting up so I turned it off and back on again to see if it would help but now it will not activate again
-
Enlargement of font on my hp printer
my hp photosmart printer C4180 prints very small fonts hardly readable on only half the A4 size paper.Kindly let me know how to enlarge fonts of the printer
-
Metadata auto completion in PS CC 2014
When entering metadata (File -> File Info) in PS CC, auto complete would fill in words that I commonly used across the metadata. As far as I can tell this no longer is in PS CC 2014. The Preferences dialog for File Info looked like this: The same dia
-
After updates with ios7 lost sound , did reset now I lost wifi, asking me password
After updates now my wifi on iPad asking me for password
-
Performance of mac is slow what i have to do
performance of my mac is slow what i have to do