LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error using database toolkit

Hello,
 
I'm using a DB Tools open Conection.......to get data from a SQL database....when I run the VI's it appears the following error:
 
Error -2147467259 occurred at DB Tools Open Connec (String).vi->connect_sql(1).vi
 
Possible reason(s):
Exception occured in Microsoft OLE DB Provider for ODBC Drivers, [MySQL][ODBC 3.51 Driver]Too many connections.  in DB Tools Open Connec (String).vi->connect_sql(1).vi
 
I don't know why it happens.....i've attached the sub vi's. It can be the drivers I'm using for this database?
 
Thanks
 
 
0 Kudos
Message 1 of 3
(3,300 Views)

The error is described as too many connections, so this probably happens because you open a connection and then try to open another without closing the first (or whatever number of connections you can have open simultaneously). Move the open connection out of the loop, place a close connection after the loop and make sure you have a proper way to stop the loop. If you only want to run this once, you don't need the loop. This is also true if you want to run it as a subVI.

 
These things apply to any reference based action in LV (TCP, File I/O, queues and so on) - You need to open a resource once, use the reference you get in all the functions you need and then close the resource.
 
To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).

___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(3,295 Views)

am using database toolkit and i have this error code appearing  -2147217900 when i try to use update data.vi .

 

0 Kudos
Message 3 of 3
(2,697 Views)