LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error message while attempting to read table from SQL Server

Solved!
Go to solution
Solution
Accepted by topic author JLuna

No, I don't think the timeout on the Labview code is the issue. It looks like the SQL server is not available for some reason and your connection attempt times out.  You could try to handle the error returned by the SQL driver and then try to connect again and repeat a couple of times and if there is no connection after a few attempts then throw a connection timeout error. This way you can handle the error in your Labview code rather than having the SQL timeout error stop your program.

0 Kudos
Message 11 of 17
(2,660 Views)

If you make the VI that causes/catches the error shared re-entrant, you can have it use the Clear Error VI with the specific number, and then use the boolean output to run a case structure with a Wait and then call the same VI again (i.e. itself)


GCentral
0 Kudos
Message 12 of 17
(2,615 Views)

Well it makes sense what you're stating. I'll give it a try. Thanks for your reply.

0 Kudos
Message 13 of 17
(2,585 Views)

very well


@cbutcher wrote:

I'd go ahead and guess the error code is -2147467259 from the linked posts.

From the explain window I only get the following (perhaps I'm missing a relevant toolkit?):

Error -2147467259 occurred at an unidentified location

Possible reason(s):

LabVIEW: (Hex 0x80004005) Unspecified error.
=========================
LabVIEW: (Hex 0x80004005) Unspecified error.
=========================
NI System Configuration: (Hex 0x80004005) Miscellaneous operation failure.

 

The first linked post however gives the following message:

ADO Error: 0x80004005
Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. in NI_Database_API.lvlib:DB Tools Open Connec (String).vi->RecipeSelect.vi

 which makes it sound like the error is thrown by the database directly, due to an access violation. I'm guessing it doesn't finish initializing before the connection is called, or similar.


 

0 Kudos
Message 14 of 17
(2,299 Views)

What I basically had to do is that when I get this type of error, I save the query in a .txt file. I execute the saved queries when connection to SQL Server is established back again.

 

Thanks all for your support.

0 Kudos
Message 17 of 17
(2,278 Views)