LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange MySQL/ LabSQL error

Hi All,

 

I am running Labview 13.0 on Windows 7 in Parallels on my mac. My database is a MySQL database on Amazon's RDS server. I am using windows ODBC to connect to it. I have been using LabSQL to manage the database needs of my program. I am getting the following error when I write a new item to my database:

 

 

Error 2146824584 occurred at Exception occurred in ADODB.Recordset: Operation is not allowed when the object is closed. Help Path is C:\Windows\HELP\ADO270.CHM and context 1240653 in ADO Recordset GetString.VI -> SQL Fetch Data (GetString).vi -> SQL Execute.vi -> MyVI.vi.

 

In general, here is my order of operations for the write:

Create com> Open Com > SQL Execute >Close Com. I only open and close the com one time in this program, so it's not being closed elsewhere.

 

I don't think anything is wrong with my connection line or command line since when I go in and check the DB, the item is there in its entirety. I could just take the guilty vi out of the error handling, but that seems like a poor "fix".

 

Please let me know if you need any further information. Any suggestions?

 

Thanks!

0 Kudos
Message 1 of 5
(3,564 Views)

Please attach all the relevant VIs (if you have more than 2, bundle them into a ZIP file and attach that).  If you are doing the operations (and only those operations) as you say you are, you shouldn't be getting the error message suggesting you're doing some SQL operation after the file is closed.  But that seems to be your error message.  Suggests that the code isn't necessarily acting the way you think/want it to, and I can't advise where the problem might be without seeing the code.

 

Bob Schor

0 Kudos
Message 2 of 5
(3,548 Views)
Make sure everything is wired correctly. You may have thing happening "out of order".

Also, can we see the SQL that you're running?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 5
(3,522 Views)

I have made a small VI that gets the same error. The original VI relies on a MyRIO to run.

 

Thanks for your help!

 

0 Kudos
Message 4 of 5
(3,499 Views)

The single VI that you included needs at least a half-dozen other VIs in order to make any sense.  At the present, all we know is that you are using the Build Text Express VI to create what looks like a SQL command (INSERT INTO ...), and you appear to be executing 4 unspecified VIs using these data.

 

Try the following and report the results:

  1. If you delete the last four sub-VIs (i.e. everything after the Build Text command) and run the code, is the Text string that you get out reasonable and meaningful?  I notice that many of these strings pass through another unknown sub-VI (escape_mysql_characters) which you have not provided.  You would know best if the string that you get "makes sense" in the context of your SQL request.
  2. If you only keep the last four sub-VIs (the SQL stuff) and put a Text constant into the third block, does something reasonable happen?  I notice that the first SQL function appears to have no inputs, i.e. it does not seem to attach to a database -- is that correct?  Is that how it is supposed to be?

Bob Schor

 

P.S. -- LabSQL appears to be more than a decade old, certainly pre-dating "modern" LabVIEW (e.g. LabVIEW designed for Windows 7) and modern Windows (Windows 7 and above, and 64-bit Windows platforms).  This, in itself, might present problems ...

Message 5 of 5
(3,481 Views)