LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error when using Conn Set Properties

I have a LabVIEW application that uses a SQL database to store data.  Occasionally, the database write will fail due to a timeout when a file system backup starts (i.e., if the failure  occurs, it always occurs at this time).  The vi that writes to the database uses the basic "open-write-close database" architecture.  In an attempt to eliminate the timeout error, a call to the DB Tools Set Properties vi was added after the database is opened.  I then wired a cluster with a timeout value of 5 seconds to the "connection properties" input of the vi.  While this vi compiles OK, when I run it, I get the following error message:

Error -2147467259 occurred at Conn Set Properties.vi->Write SQL Table.vi

Possible reason(s):
Exception occured in ADODB.Connection: Property value is invalid. Make sure the value is typed correctly. in Conn Set Properties.vi->Write SQL Table.vi

Do I need to add an entry for the default database in the conn properties typedef?  If so, what value would I use?
0 Kudos
Message 1 of 5
(3,843 Views)
Please refer to this knowledgebase.
Warm regards,
Karunya R
National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(3,806 Views)
This KB article doesn't really address my problem.  The vast majority of the time, the application runs fine.  I will occasionally get the error when a backup process starts on the server computer.  This is a problem because the application is used in a compliance test that runs for several hours and we don't want to restart the program in the middle of the test.  During the most recent test, we simply cancelled the scheduled backup for the duration of the test.  That obviously works, but a better solution would be to find a way to prevent the error, which is why we were trying to increase the timeout period. 
0 Kudos
Message 3 of 5
(3,800 Views)
In your case it sounds as though the error isn't affecting anything important or signficant if it is pops up when the backup process start. Are there any other scenarios than this when this happens? Does error affect data that you are receiving? The next time you get this error, you can higlight execution to see what happens on the block diagram.

 So one solution would be to ignore the error itself. There are multiple ways to this. Here is a knowledgebase that describes how to do it. This discussion forum also has another few methods on how to ignore the error.

Good luck!
Warm regards,
Karunya R
National Instruments
Applications Engineer
0 Kudos
Message 4 of 5
(3,780 Views)

Workaround for when you get -2147467259 when writing to a LOCAL SQL database and you lose connection to the REMOTE DHCP server:

 

I am writing to a local SQL Server Express database (with TestStand).  Periodically we have an application that pushes the test station data to the main SQL Server.  When I pulled the network cable, I got Error -2147467259 even though I was only writing locally.  I was able to change the Data Link Properties in the UDL file editor to get around this error dialog. 

 

Instead of "MachineName\SQLExpress", I used "localhost\SQLExpress" for the server name.  This could be somehow related to bypassing the DHCP based machine name.

 

Here was the error message:

 

==================================================
DETAILS:
An error occurred calling 'LogResults' in 'ITSDBLog' of 'zNI TestStand Database Logging'
An error occurred executing a statement.
Schema: SQL Server Stored Proc (NI)
Statement: UUT_RESULT.
Description: Connection failure
Number: -2147467259
NativeError: 0
SQLState: 08S01
Reported by: Microsoft OLE DB Provider for SQL Server

Source: TSDBLog


==================================================
ERROR CODE:
-2147467259; User-defined error code.
Possible System Error: Unspecified error

==================================================
LOCATION:
Step 'Log Results to Database' of sequence 'Log To Database' in 'Database.seq'


Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
0 Kudos
Message 5 of 5
(3,600 Views)