LabVIEW and SQL – Part 2 – an example

One Record at A Time

This example (by Jeff) shows you “one record at a time”; for example if you use a SELECT statement in SQL.

It helps to have the error cluster displayed, in order to catch errors in your SQL statements. 

Let’s discuss how to implement this code with standard ADO functions.

Example 1

1: Connection: You create a Connection Object with Connection Create. Then connect to with the DSN name and Connection Open.

2: Create a Command: You create a command object with Command Create, set the text with Command Set Command Text), select the active connection with Command Set Active Connection fest. Then Command Execute, which returns a Recordset. Destroy your Command object, you won’t need it no longer.  

3: Loop through Recordset: If you haven’t reached Recordset EOF yet, get a line with  Recordset Get String.

4: End:  Connection Close+ Connection Destroy.

Source: LabSQL Examples

Source: LabSQL Examples

Same thing, from the examples. More efficient with the SQL Exectue, different UI. He should have destroyed the Connection Object, though.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: