Example Code

Database Connection and fetch data

Code and Documents

Attachment

Overview
Demonstrate how to test database connection and fetch the data using the SQL query. Provide SQL query based on your database setup.

 
Description
When accessing database using LabVIEW, ActiveX or Database connectivity toolkit can be used. Database connectivity toolkit is a addon to LabVIEW.

Common steps to connect with database when using Active X or Database connectivity toolkit are similar .

 
Requirements

LabVIEW 2013 (or later)


Steps to Implement or Execute Code

  1. Setup your Database
  2. Launch the project "Database_Sample.lvproj" and select "TestDBConnection.vi"
  3. Set DBO Path and Connection Method and press Test Connection button. If connection is successful create SQL Query and press Send Query button to fetch data.

Additional Images or Video

 

DatabaseInfo.png

 

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

*************************************************
CLD
*************************************************

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

Comments
JulianT
Member
Member
on

Hello,

I guess I need the database connectivity toolkit to run the exmaple project?

SKant
Member
Member
on

Hi,

I wanted to create a table using Labview database connectivity toolkit  functions and also wanted to  assign a Primery Key and Foreign Key using labview in SQL database table.

is this possible using Labview database connectivity toolkit  functions.

Thanks

Srikant

AtulS
Member
Member
on

Zip folder doesnt contain Example for ActiveX