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 KB

Hi 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

Similar Messages

  • Write Data to Wonderware Historian from LabVIEW

    I am looking to log data acquired using LabVIEW and CRIO to a Wonderware Historian.  If someone has experience in this area, would you mind sharing the way you accomplished it?  The cRIO unit will be connected to a TPC-2212 also.
    Thanks in advance!
    Bob C

    Hi BobbyCee,
    I am not familiar with the Wonderware Historian since it is not an NI product, but it looks like it is a SQL server.  Where will you be hosting the SQL server?  How are you planning on communicating with it?  
    The Database Connectivity Toolkit is typically used for communicating with SQL servers.  
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/209​060 
    You may want to contact Wonderwave to see if it is compatable.
    Hope this helps!
    Dayna P.
    Applications Engineer
    National Instruments

  • 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.

  • 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,
    Hasna

    On 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.

  • 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 KB

    On 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

  • Database access from session bean

    Hello,
    I have a stateless session bean which performs some complex
    calculations, and also does some database access.
    For the database access the bean class has a datasource as
    follows:
    public class TestBean implements SessionBean {
    private DataSource ds_;
    public void ejbCreate() {
         getDataSources();
    private void getDataSources() {
         try {
         Context ictx = new InitialContext();
         ds_ = (DataSource)ictx.lookup("java:comp/env/jdbc/TestDB");
         } catch (Exception e) {
         e.printStackTrace();
         throw new EJBException(e);
    Now this class has a method (which is also in the remote interface)
    calculateSomething(). This method constructs a number of other
    objects that do the actual calculation, and one of these objects
    does the actual database access. How would another object be able to
    use the datasource that was constructed in the bean class?
    I could pass the datasource reference to that object, but that would
    break my encapsulation. This is because that object does not get
    created directly by the bean object, but rather the way the objects
    interact is something like A -> B -> C, where A is the TestBean, and
    C is the object that does the DB access. If I passed the datasource,
    I would need to make B aware of the datasource, which doesn't
    seem good design, because B doesn't do any database access.
    Alternatively I could do the lookup in class C, but that would
    degrade the performance, as an object C gets created and destroyed
    every time the calculateSomething() method is called.
    A third option I have thought of, is to add a public method to the
    bean that returns a connection. Whenever another object gets
    created, a reference to the bean object will be passed along. Then,
    if another object needs to do database access, it will call back
    the bean to get a connection. This seems just as bad (if not worse)
    than the first option.
    Does anyone have an elegant solution for this situation? What is
    the best practice of handling datasources when a bean class doesn't
    do the database access itself? In all the examples I've seen so far,
    all the functionality was in the session bean class, but again that
    doesn't seem good OO design, and would result in a single huge class.
    regards,
    Kostas

    Thanks again to both for the replies. Here are my responses:
    Yi Lin: Yes, I know that an entity bean would solve this problem, however it has been decided not to use entity beans so this is not my call (I think the reason entity beans are not allowed in this project is that they are considered risky: there are other applications that access the same database, so if the container caches entity bean data as you describe, then the users might get inconsistent results).
    Gerard: Actually object B is the one that has the business logic and C is a peer object that only does database access and no calculaitons. For example B can be Customer, and C CustomerDB. This is why object B does not have any knowledge of datasources or connections. So my design does not appear to be that bad!
    As far as the factory you propose is concerned, I cannot understand how this would solve my problem. In order to solve this situation the factory would need to be persistent, i.e. get created by the ejbCreate() method, and destroyed whenever the container decides to destroy the bean. There would be no point in object C creating the factory, as I would have the overhead of doing the JNDI lookup every time I create a C.
    So the question remains the same: how would I pass a reference to the factory from A to C without making B aware of it?

  • Database access from Oracle Java Cloud Service application

    I have registered for Oracle Java Cloud Service for trial period. I want to deploy a Spring MVC 3.2 and Hibernate 4.0 web application.
    I created a table in the Database Cloud. I am not sure how do I access the Database Cloud Service from my application.
    Need your guidance/pointers/references that can help me establish connection from my application to the database.
    Thanks,
    Ujjwal

    Hi,
    Use JPA - see the visitors example, it uses @PersistenceUnit injection with previously weaved .class entity files.
    You can use application managed EMF's and EntityManagers with code like the following - which is not preferable to using @PersistenceContext injection on an @Stateless session EJB but...
              EntityManagerFactory emf = Persistence.createEntityManagerFactory("JPAServletPU");
              EntityManager em = emf.createEntityManager();
              EntityTransaction transaction = null;
              try {
                   transaction = em.getTransaction();
                   transaction.begin();
                   Visitor entity = new Visitor();
                   entity.setName(name);
                   entity.setNum(num);
                   em.persist(entity);
                   transaction.commit();
                   System.out.println("Committing: " + entity);
              } catch (Exception e) {
                   e.printStackTrace();
              } finally {
                   em.close();
                   emf.close();
    Use a persistence.xml like the following
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    <persistence-unit name="JPAServletPU" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
         <!--https://cloud.oracle.com/mycloud/f?p=5300:1000:259334829915901-->
    <jta-data-source>database</jta-data-source>
    <class>com.vision.cloud.jpa.Visitor</class>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
         <property name="eclipselink.target-database" value="Oracle10g" />
    <property name="eclipselink.ddl-generation" value="create-tables"/>
    <!-- property name="eclipselink.ddl-generation" value="drop-and-create-tables"/-->
    </properties>
    </persistence-unit>
    </persistence>
    Check out a tutorial on WebLogic JPA ORM usage here to get started as well.
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial

  • How to enable database access from Java or CSharp ?

    I set up an Oracle Express database on my local computer.
    Now I want to connect to this databsee from a CSharp (or Java) program.
    How do I have to specify the connection string?
    The following does NOT work:
    connectionstring = "Data Source=XE;User Id=karl;Password=mypassword";
    connection = new OracleConnection(connectionstring);
    connection.Open();
    I am getting an error
    "Invalid argument" ORA-12532 error
    How do I have to specify the connection string otherwise ?
    Is the sequence of the parameter Data Source, User Id and Password
    important ?
    How do I get a more detailed error message from Oracle ?
    Do I have to enable the accessibility from outside programs
    in Oracle somewhere ?

    about to the error:
    ORA-12532 TNS:invalid argument
    Cause: An internal function received an invalid parameter. This message is not normally visible to the user.
    Action: For further details, turn on tracing and re-execute the operation. If the error persists, contact Oracle Support Services.
    Regards

  • Create a table and upload data in MS ACCESS from SAP ABAP programming?

    Hi All,
    How to create a table in MS ACCESS database and Upload SAP database table data into MS ACCESS table using ABAP programming?
    Explain: My client requirement is " If he/she runs a ABAP Program, that will create a table and upload data into MS ACCESS Database table in background. "
    Could you please give the solution or code? I know the program RIACCESS and I went through the SAP Note 583698.
    Is this only solution for this?  Or Any other possibilities?
    Please give me solution.
    Thanks in advance.

    Hi,
    It is not possible to create tables in a non SAP schema from inside SAP.
    The SAP-Oracle license also does not allow you to create the table (see note 581312):
    the following actions, among other things, are therefore forbidden at database level:
    Creating database users
    Creating database segments
    Querying/changing/creating data in the database
    Using ODBC or other SAP external access methods
    Please refer following link,
    [Ckick Here|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
    You can also do it by LSMW,
    If you are using Access 97, you can download directly into an access
    database from SAP. See program RIACCESS for details. You have to establish
    an RFC destination PS_ACCESS_1 and 2.
    There are then a couple of function modules. Go to SE37 and put in
    msaccess and hit PF4.
    The following is from the readme file: sapgui/ps/readme.sap
    For the MS-Access interface SAP delivers 4 files:
    WDPSASTR.EXE This is an RFC server program that is called by SAP R/3
    (PS module). This program creates a MS Access database. The structure
    information of the tables is transferred from R/3. In addition to
    these tables a table named DDIC is created. This table contains the
    structure information and should in no case be modified or deleted.
    WDPSATAB.EXE This is an RFC server program that is called by SAP R/3
    after WDPSASTR. This program filles the tables of the database with data.
    There must not be made any changes of the structure of
    the tables between the calls of WDPSASTR and WDPSATAB.
    WDPSAZET.EXE This is an RFC client program that triggers work/time
    confirmations in the PS module of SAP R/3 (like transaction CN27 Collectiv
    confirm).
    WDPSAMAT.EXE This is an RFC client program that triggers material
    confirmations in the PS module of SAP R/3 (like transaction MB1A - Goods
    Please also refer following links,
    [Click here|Upload data from MS Access tables, to SAP tables.;
    Before using the program "RIACCESS", you need to install the PS utilities, which are part of SAPGUI install CD.
    It is available in the "SAPGUIPS directory".
    Then do the followings :
    1. Select transaction code SALE -> Systems in network-> Define RFC Destination.
    2. You will need two RFC destinations (TCP/IP connections for the front-end workstation).
    Setup the two RFC destinations PS_ACCESS_1 and PS_ACCESS_2 and you'll have to get them to point to
    wdpsastr.exe and wdpsatab.exe respectively.
    3. Then execute RIACCESS and choose PS_ACCESS_1 to generate access tables.
    The system must also be able to access the RFC-DLL files (librfc2.dll, librfc3.dll, librfc4.dll, librfc5.dll, librfc6.dll, vrfc.dll).
    Please note that Access only supports tables with up to 255 fields.

  • Possible data loss whlie transfering from Labview 7.0 into Matlab [binary]

    Greetings,
    I am kind of confused on binary data processing from labview to matlab. I tried to follow this thread by C. Minnella:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=211371&query.id=131675#M211371
    And it was a great help for me to understand many of my issues. However there is something wrong with data that I am writting and retrieving in Matlab
    Here is how signal looks in Labview
    http://img126.imageshack.us/my.php?image=picture1va4.png
    And its spectrum
    http://img126.imageshack.us/my.php?image=picture3hn6.png
    http://img146.imageshack.us/my.php?image=picture4br6.png
    And this is what I am getting in Matlab:
    http://img357.imageshack.us/my.php?image=picture7jq7.jpg
    my vi:
    http://img146.imageshack.us/my.php?image=picture2wn0.png
    The only change I did was replacing DAQ task with Global chanel constant, since it has original scaling for the data from Load Cell (Fx Axis in particular), this is the device I am getting data from, it is in rest, sitting on the table.
    I can't figureout what is happening, looks like it is clipped, besides the amplitude is not correct.
    Would really appreciate any insights,
    Oleks 

    Hello Ton,
    Thank you for the fast reply, here is a part of the code that reads from Labview data file:
    %Read header information, return in a structure[headerInfo,fileMark] = GetHeader(fileName,pathName, dataBytes);
     %Open binary file Big endian formatfid=fopen([pathName fileName],'rb','ieee-be');  %Move file marker to begining of scansfseek(fid,fileMark+startScan,'bof');  %Read number of requested scansy=fread(fid,headerInfo.NumChannels*scans,dataType);
     %Reshape data into a matrix [scans x channels]y=reshape(y,headerInfo.NumChannels,[])';
     %Close binary filefclose(fid);
    I basically followed example posted in 2006 on NI forum. I think my major concern is whether data is getting to matlab scaled correctly (it is scaled within global channel to Newtons) and looks like I am not getting the same data type in Matlab.

  • Insert Time and Date into Microsoft Access from Lookout

    I have an SQLExec running to export data to Microsoft Access - I would like to get A) A time stamp also to insert and B) A time stamp with out / and : -- I have found it impossible (from my limited knowledge) to do any of these things.
    Dose anyone have a very basic SQL Statement that might guide me on my way?
    Thanks!

    Oracle stores date and time in a DATE column; it all depends on how you have your insert statement. The last insert I specified the date and time
    ex.
    insert into test_date values(1,sysdate);
    insert into test_date values(2,sysdate-10.9);
    insert into test_date values(3,sysdate-8.098 );
    insert into test_date values(4,sysdate-5.11 );
    insert into test_date values(5, trunc(sysdate));
    INSERT into test_date values(6, to_date('01-JAN-2004 19:30', 'DD-MON-YYYY HH24:MI') );
    select * from test_date ;
    ID DDATE
      1 25-FEB-04
      3 17-FEB-04
      4 20-FEB-04
      5 25-FEB-04
      2 14-FEB-04
      6 01-JAN-04I don't see the time because the NLS_DATE_FORMAT is set to DD-MON-YY, but if I
    Select id, to_char( ddate , 'DD-MON-YYYY HH24:MI:SS AM') from test_date;
    ID TO_CHAR(DDATE,'DD-MO
    1 25-FEB-2004 06:57:02
    3 17-FEB-2004 04:37:05
    4 20-FEB-2004 04:20:02
    5 25-FEB-2004 00:00:00
    2 14-FEB-2004 09:24:50
    6 01-JAN-2004 19:30:00

  • 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

  • Trying to write data to file (time from timestamp + velocity + temperatur​e)

    Hello all. I've received a considerable amount of help from many of you recently, and once again I'm seeking assistance.  Having spent the majority of my LabVIEW time dealing with GPIB and data aq boards, I'm still struggling with various aspects of serial communication.  I have been working on a .vi to both control and accept data from a Furness Micromanometer.  The last task is to write the data to a file.  Attached is a copy of the vi, as well as what the front panel looks like after a test, and the resulting data saved to disk.  Anyone have any suggestions on how I should change the formatting of the data, or do whatever else might be necessary, so that my laptop and the micromanometer will get along and play well together?
      Below is the data saved to the text file, as well as the front panel showing what SHOULD have been saved. See next posting for vi.
       @6      @6      @6      @6      @6      @6      @6               
    8:00:00 PM             
    8:00:00 PM  
    1:41:28 PM             
    8:00:00 PM  
    1:41:28 PM  
    1:41:37 PM?²-V     
    8:00:00 PM  
    1:41:28 PM  
    1:41:37 PM  
    1:41:47 PM?°£×
    =p¤     
    8:00:00 PM  
    1:41:28 PM  
    1:41:37 PM  
    1:41:47 PM  
    1:41:57 PM?éãS÷ÎÙ     
    8:00:00 PM  
    1:41:28 PM  
    1:41:37 PM  
    1:41:47 PM  
    1:41:57 PM  
    1:42:07 PM?ÿt¼j~ùÛ     
    8:00:00 PM  
    1:41:28 PM  
    1:41:37 PM  
    1:41:47 PM  
    1:41:57 PM  
    1:42:07 PM  
    1:42:17 PM?ûhr° Äœ     
    8:00:00 PM  
    1:41:28 PM  
    1:41:37 PM  
    1:41:47 PM  
    1:41:57 PM  
    1:42:07 PM  
    1:42:17 PM  
    1:42:27 PM?ÆéxÔýó¶      
    8:00:00 PM  
    1:41:28 PM  
    1:41:37 PM  
    1:41:47 PM  
    1:41:57 PM  
    1:42:07 PM  
    1:42:17 PM  
    1:42:27 PM  
    1:42:37 PM?ý‡+ J

    It looks like you have not formatted your data properly to save it. Can you post a bit of you code? It would be easier to advise you.
    Mike...
    PS: Where are you at with Corning? I spent about 2 yrs in Painted Post...
    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

  • Database Access from JSP - Is it correct?

    From a JSP Page, we need to retreive data from the database. We have our own application specific API commands to retreive data from database. We have doubts in using this API commands.
    Approach 1:
    From the jsp, send the query details to a Java file (BO). From the java file (BO), call the database and retreive the data
    Approach 2:
    Use the API command directly from the jsp page to retreive details from the database.
    In both approaches, the same API command is going to be used. We just want to know is there any advantage in calling the database through the java file (BO) instead of directly from the jsp?
    Regards,
    R.Aravinth

    Thanks Ram. But we are not going to have any complex
    codes written for data retreival. We just epxect a
    single line of code which will call database and that
    API command will return us a storage variable which
    we will use for displaying purpose.
    ok take a look at this
    //code to display lot of other stuff
    <%
        try {
           //code to access db and get data;
        catch(SomeException e){
            //oh-oh you are already on the display logic and have output a lot of stuff
            //how do you handle this
    %>versus this
    //code in some handler or bean
       try{
               //code to get data
              //set an attribute to enable a redirect to jsp page
        catch(Exception e){
              //handle exception, log ?
              //set an attribute to enable a redirect to error page
    Anyways, i wanted to know will the performance of the
    page improve if we call the database from a separate
    java rather than directly from jsp?As evnafets said, the answer is no. It may even be faster :)
    cheers,
    ram.

  • 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

Maybe you are looking for