NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

read results from database with python

I want to use a python code to create a custom report for my team, I think that reading the values from the database would be more comfortable than parsing and manipulating an xml file.

when I try to connect to the database, I'm promoted with an error that says that "sqlite3.DatabaseError file is not a database file", I connect to the Teststand Results.mdb file from the C:\\Users\\Public\\Document\\National Instruments\\Teststand 2020 (32-bit)\\Component\\Model\\Teststand Results.mdb path and I'm using the python library sqlite3 to attempt to connect.

 

Strangely, the error doesn't occur when I'm connecting (with the command sqlite3.connect("C:\\Users\\Public\\Document\\National Instruments\\Teststand 2020 (32-bit)\\Component\\Model\\Teststand Results.mdb")) but rather when I'm attempting to perform the query (with the command sqlite3.execute("select * from UUT_RESULTS"))

 

Am I doing something wrong? is there a guide that I can follow about this?

0 Kudos
Message 1 of 9
(784 Views)

Just an educated guess.... are you sure the database format choosen works with your sql toolkit?

 

Sounds like they kinda understand each other, but not entirely...

0 Kudos
Message 2 of 9
(747 Views)

that is part of my question, if I need to change the toolkit I will but I wonder if I have done it all as expected

0 Kudos
Message 3 of 9
(739 Views)

Would you mind sharing your Database Result Processing Options?

Screeshots will do!

0 Kudos
Message 4 of 9
(732 Views)

sadly, my workstation is an offline station, but I will try to describe the fields as accurate as I can:

in the logging\data link option, the logging options are set to include execution time but not to use on-the-fly report and not to use transaction processing.

in the datalink options, the selected database management system is access, and the connection string expression is a path to the Teststand Results.mdb as I pointed in my original question.

if it is relevant, the include step results option has everything enabled (I mean the measurements, test limits and additional results, also the result filtering expression is set for all results)

0 Kudos
Message 5 of 9
(719 Views)

Have you already tried the interaction of some dummy Access DB and your Python lib to exclude TestStand as a "source of trouble" ?

0 Kudos
Message 6 of 9
(715 Views)

I don't think that I fully understand your question

I can access the database by using access and with the teststand data viewer, if that is what you meant

0 Kudos
Message 7 of 9
(678 Views)

Let me re-phrase:

 

Have you tried using the sqlite3 packages with a different Access Database than the one created with TestStand?

--> is the sqlite3 able to speak to Access?

0 Kudos
Message 8 of 9
(674 Views)

after careful examination, I can say that my code (using the sqlite3 package) cannot connect any of the access database file: .mdb(97-2000), .mdb(2000-03) and .accdb

for any of the version of access available on my machine the result was with the same error message

I wonder why it happens on my machine, should I use any other database?

0 Kudos
Message 9 of 9
(626 Views)