NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Database Object Reference variable is NULL

Hi,

In TestStand 3.0, I am trying to override the station database options through a DatabaseOptions (sub)sequence. When I execute the MainSequence I get the following runtime error when I try to change the Parameters.DatabaseOptions.ConnectionString variable: Error (The Object Reference variable 'RunState.Root.Locals.DBLogRef' is NULL.)

The step expression is Parameters.DatabaseOptions.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" + FileGlobals.OutputDatabasePath + ";"

According to the documentation, I should be able to change the database options by using this method. This problem appears with the standard SequentialModel, as well as my own custom model. What may be the cause of this error? Is there another step which must occur prior to the DatabaseOptions sequence?

Thanks,
Philip
0 Kudos
Message 1 of 5
(3,482 Views)
I am not familiar with Microsoft jet OLEDB 4.0, but I think something is wrong with your connection string. That is why you are getting a NULL value at run time. Shouldn't you have a user id and password somewhere in your connection string? Is the syntax correct (semicolons)?
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 5
(3,475 Views)
At this point in the sequence I am simply trying to change the value of Parameters.DatabaseOptions.ConnectionString. Unless changing this parameter triggers an event to connect to the database, I don't think that is the issue. The connection string is the same one as created by the Build button in the Configure>Database Options...>Data Link tab. Manually creating this link works (with the FileGlobals.OutputDatabasePath hardcoded with the appropriate string), but overriding the connection string while executing the sequence does not.

Semi-colons are correct, but perhaps there is another delimiter that has a different operation that is better.

Any other thoughts?

Philip
0 Kudos
Message 3 of 5
(3,470 Views)
Sorry, nothing else comes to mind. Are you sure about the last semicolon? Try deleting it. I have seen this work before, setting the ConnectionString parameter. The fact that you are getting a NULL tells me that the connection is not being made. I don't know what else to try, sorry.
- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 5
(3,459 Views)
Philip -
What step is raising the error? Is it a step in the process model sequence or in your sequence? Can you attach the text from the error message that TestStand is raising?
Scott Richardson
https://testeract.com
0 Kudos
Message 5 of 5
(3,439 Views)