NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read a Database in Teststand 4.0

Hi,

 

My question is how to read a Access Database in Teststand 4.0....

Writing is not the problem.... but now i want to read a Number into a FileGlobal....

I've already tested some SQL Statements but they all result in an Error....

 

Can somebody give me an example for this Problem?

 

Thanks

 

_____________________________________
Givin´ um something to Rock´n´Roll about
0 Kudos
Message 1 of 5
(4,565 Views)

Chevydevil -

There is an example that ships with TestStand under the Examples\Database directory. TheWritingAndReadingTableData.seq illustrates how to read and write data between TestStand and an Access database using the TestStand databse step types. Is this what you are looking for?

Scott Richardson
https://testeract.com
0 Kudos
Message 2 of 5
(4,558 Views)

Hi,

 

I've found this example but i cant figure out, how it reads something from the Database...

All i can see is, how it writes something.... ?

_____________________________________
Givin´ um something to Rock´n´Roll about
0 Kudos
Message 3 of 5
(4,542 Views)

Chevydevil -

The first half of the sequence writes the values to the database, the second half reads the values from the database. After the "Close SQL Statement" step in the middle of the sequence, the "Open SQL Statement" step reopens the table using a SELECT statement against the database handle that was used to write the values. The "Start Loop 2" and following "Goto" step setup a loop, and the "SQL Action - Fetch Next" step selects the next record in the query. The "SQL Action - Get Values" step gets values from the current record by mapping the column name to a local variable. The "SQL Action - Get String Value" step shows that you can also request the value of a record separately, in this case a string value.

 

The cleanup step group ensures that you properly close the statement and database handles.

Scott Richardson
https://testeract.com
0 Kudos
Message 4 of 5
(4,529 Views)

Hi Scott,

 

it took me some time, but now it works fine 😄

Thanks a lot 🙂

_____________________________________
Givin´ um something to Rock´n´Roll about
0 Kudos
Message 5 of 5
(4,513 Views)