From 11:00 PM CDT Friday, May 10 – 02:30 PM CDT Saturday, May 11 (04:00 AM UTC – 07:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Utility for generating SQL statements for MS-ACESS

Code and Documents

Attachment

I tend to do a lot of work with the Database Connectivity toolkit and MS-ACCESS.  Trying to figure out why a long SQL statement wouldn’t work correctly can be frustrating and time consuming to fix.  And while you can paste your SQL statement into an MS-ACCESS query, the differences in string / date formatting between MS-ACCESS and the Database Connectivity Toolkit can sometimes make a bad situation worse. 

I finally decided there had to be an easier way and came up with these three simple utilities for generating “SELECT”, “INSERT”, and “UPDATE” SQL statements.  The utilities work with any ODBC configured MS-ACCESS database. Since the utilities retrieve actual table and field info typos and formatting issues are a thing of the past.

To use the utility enter the DNS name and run the vi.  Select the desired table (yes it only supports any one table at present) and then the fields you which to include.  When satisfied with your selections press the “Generate SQL statement”.  Just cut and paste the resulting SQL statement into your code and your good to go!  This has made my life a lot easier and I hope it makes your easier to!  Bug reports welcomed.

(Developed in LabView 8.5)

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

Comments
_user32
NI Employee (retired)
on

Les, helped me out in a pinch - thanks!

Contributors