Example Code

Create or Drop a Table Using LabVIEW Database Connectivity Toolkit

Code and Documents

Attachment

  1. Overview
    • This VIs has been built to create or drope tables in an Access DataBase
  2. Description
    • This example uses a MS Access "Test Results" Database to show how to programmatically create or drop a Table and how to connect to an Access Database
  3. Requirements

    • LabVIEW 2012 (or Compatible) 
    • Database Connectivity Toolkit
    • MS Access 2013 (or Compatible)
  4. Steps to Implement or Execute Code
    • Run the VI
    • Write a the name of the column you want to create/drop
    • If you're going to create a column, you have to create the array of clusters, each position in the array will be a column in the table. For each column you have to set the name, data type, size (only if it's a string) and check the box if the column will allow null values.
    • If you create a column and you need to select the Primary Key, then use the "primary key (Column) to choose which column will be the primary key (zero indexed)
  5. Additional informations or References
    Database.PNG

NOTE: If you just want to drop a table, yo only need to write the name of the table and click the Drop Table button.

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

 

Arturo Gómez | Applications Engineering
Certified LabVIEW Associated Developer

National Instruments Latin America
01-800-010-0793
ni.com/support

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.