10-22-2008 10:54 AM
I have multiple database schemas on my TestStand system and when I select a sequence file I need to set the schema so the results get entered into the database correctly.
I use a SequenceFileCallback for DatabaseOptions in my sequence file and in this I set Parameters.DatabaseOptions.DatabaseSchema.Name='xyz' where xyz is the database schema name that needs to be used. This does not work and it reports an error that it can not be loaded or the file may be corrupted. Does this feature work or do I just have an error in what I am setting this equal to?
Solved! Go to Solution.
10-22-2008 08:15 PM
Hi plf,
It seems to me you are going about this the right way. The DatabaseOptions callback is called immediately before the process model fetches the schema statements based on the schema name. I was able to change the schema on the fly in the same way you are attempting (using the default sequential model and TestStand 4.1).
Evan Prothro
RF Systems Engineer | NI
10-23-2008 12:48 PM
10-23-2008 01:02 PM
Evan Prothro
RF Systems Engineer | NI
02-13-2009 01:34 PM
I am trying to do the same thing, although I am using a mysql database and I am not using a DSN:
I get this error when running my sequence:
An error occurred calling 'NewUUT' in 'ITSDBLog' of 'zNI TestStand Database Logging'
An error occurred initializing a connection to a data link.
Connection String:
Unexpected token: ODBC
Here is the statement:
Parameters.DatabaseOptions.ConnectionString="Driver={MySQL ODBC 3.51 Driver}; Server=localhost; PORT=3306; DATABASE=DB; Option=3; Socket=; Stmt=; Uid=USER; Pwd=PASSWORD;"
This works PREFECTLY when entered directly in the db connection string dialog. Is it trying to further parse my statement? Do I need to escape the "s? I will try that.
02-13-2009 01:46 PM
Dude. You guys crack me up. TS is parsing the connection string! You need to add another (escaped) set of double quote.
This works:
Parameters.DatabaseOptions.ConnectionString="\"Driver={MySQL ODBC 3.51 Driver}; Server=localhost; PORT=3306; DATABASE=DB;
Option=3; Socket=; Stmt=; Uid=USER; Pwd=PASSWORD;\""