09-16-2009 07:07 PM
Hi,
If I select the 'Generic Recordset (NI)' along with a new empty Access database and in the Schemas tab press the Validate... button, the Schema Validation rightly finds these differences. But when I 'Generate SQL' to 'Add Missing Items' the following warning comes up three times.
"There is more than one statement logging to the same table..." etc.
Then in the Execute SQL View when I 'Execute SQL Commands' there are many errors with 'Command failed' and something like Table 'PROP_RESULT already exists'.
The only reason I am looking into this is because I cannot add a MODEL_STRING to the database without an error at the end of the database results processing.
Is this the expected behavior?
Thanks,
Ronnie
09-17-2009 01:11 PM
For the benefit of anyone else that encounters this problem:
Looking at the SQL produced, I see that there is a command to CREATE TABLE PROP_RESULT three times.
The first CREATE will be the one that is successful, while the others fail.
My particular error at the end of a test run is being caused because DATA is defined as a Double in the first table,
yet as a VarChar[255] in the others. DATA needs to be VarChar[255]. but unfortunately the first table definition
is the one that persists.
By manually changing the type of DATA from Double to VarChar[255] in Access, the problem is fixed.
So, the original SQL must be faulty. Below are the three definitions for the PROP_RESULT table. I am going to keep
the middle table definition and delete the others.
Notice also that PATH in the first table definition is LongText, but in the others VarChar[255]. Probably it should be LongText.
Perhaps this may be helpful,
Ronnie
09-18-2009 12:05 AM
Ronnie -
I am not sure if you know this but the recommended SQL statements for the default schemas are located in the <TestStand>\Components\Models\TestStandModels\Database directory and the one for the Generic Recordset for Access is Access Create Generic Recordset Result Tables.sql. You might want to review the SQL that you decided to use and compare it to this file. Also there is a default Access database located at C:\Documents and Settings\All Users\Documents\National Instruments\TestStand 4.2\Components\Models\TestStand Results.mdb that you might want to consider using as a starting point.
The purpose of the Validate button is to help consider what is missing in the current database. We will have to review its output because what you received as output does not appear correct. Thanks for letting us know.
09-18-2009 11:08 AM
Scott,
Thanks for the input. I confirmed that if I go straight for the Data Viewer and load the sql file that you mentioned, it looks good and creates the tables correctly without error. Going through the Validate instead gives a different SQL output than the actual file. This SQL doesn't work correctly.
Could I ask one more question? Could you please tell me how the schema listed here (e.g. My copy of Generic Recordset), maps to a specific SQL file in the Components\Models\TestStandModels\Database directory? Where is the association made? I see there is an export and import for ini files. Is that it?
Thanks,
Ronnie
09-26-2009 10:44 PM - edited 09-26-2009 10:46 PM
Hi Ronnie,
There is no relationship with the schema configuration specified in the Database Options tool to the <TestStand>\Components\Models\TestStandModels\Database directory. The tool records all schema configurations under <TestStand>\Cfg\TestStandDatabaseOptions.ini. The tool dynamically creates all SQL scripts each time using the information recorded in TestStandDatabaseOptions.ini. The Database directory primarily serves as a backup for the default schemas (specified under TestStandDatabaseOptionsDef.ini) and SQL scripts.
Hope that clarifies some things.
09-28-2009 12:31 PM
Thanks for the clarification Nestor.
Ronnie