Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 rating:
 1 out of 5     Rate this Document

Inserting Data in LabVIEW from Table Create Using Access 97 SQL Toolkit Syntax

Primary Software: LabVIEW Toolkits>>Enterprise Connectivity Toolset
Primary Software Version: 3.0.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem: I'm using the LabVIEW SQL Toolkit to create a table with fields, and then using SQL to insert/retrieve data in Access 97. The specific fields I'm using are Number, Date/Time, Text, Memo, Currency, and Yes/No. What syntax can I use?

Solution: Access fields can be created with different datatype declarations in the CREATE TABLE statement. For example, DATETIME, DATE, and TIME all create the Date/Time field. Reserved words can be used as table names or as field (column) names when enclosed in double quotes. In addition, there are several ways to insert valid data into the specific fields.

To create the table in Access:
CREATE TABLE "Table" (NumField NUMBER, DateTimeField DATETIME, TextField TEXT, MemoField MEMO, CurrencyField CURRENCY, TrueFalseField LOGICAL)

To to insert data:
INSERT INTO "Table" (NumField, DateTimeField, TextField, MemoField, CurrencyField, TrueFalseField) VALUES (1234.5678, '1/23/98 1:23:45 PM', 'Text up to 255 chars', 'Memo Field for more text', '$123.45', 1)

To query data:
SELECT NumField, DateTimeField, TextField, MemoField, CurrencyField, TrueFalseField FROM "Table"

For more information, please refer to the Access online help or the ODBCJET.HLP file in your Windows/System (System32) directory.

Related Links: SQL Toolkit Troubleshooting

Attachments:





Report Date: 12/30/1998
Last Updated: 11/30/2004
Document ID: 1GTF1M2I

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit