LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error when using INSERT or DELETE statements

I installed the database connectivity toolkit 1.01.

I'm trying to run an application which uses the old SQL toolkit (version 5.0) VI's. It works but when I use other statements than SELECT, I always become the error -2146824584.

Exception occured in ADODB.Recordset, Operation is not allowed when the object is closed.. Help Path is C:\WINNT\HELP\ADO210.CHM and context 0 in Get Number of Records.vi->Fetch Query Results.vi->Easy SQL.vi->SQL transaction.vi

I'm working on a Windows NT4 machine with service pack 6, MDAC 2.6 SP1 and SQL Server 7.0.

Does anyone have an idea ???

ThanX
0 Kudos
Message 1 of 6
(3,504 Views)
This is because you don't have Write access to the .mdb file or the
directory where it resides. If this is NTFS, as a test, give Everyone
Full control. And make sure the database itself is not marked Read
Only.

Also, the Jet driver writes .tmp files to either the TEMP or TMP
directories. Type "SET" at a command prompt to see where these
directories are located, and give Everyone Full control there, too, as
a test.

Jeff
0 Kudos
Message 2 of 6
(3,504 Views)
When performing a query on a database does it return any records? I think the compatibility (old SQL) VI's are closing the reference to the query if no records are returned. That is why you get the "object is closed" error message when performing a function right after doing the query. NI is aware of this issue.

My suggestion is to go ahead and replace the compatibility VI's with the new Database VI's.

Chris_Mitchell
Product Development Engineer
Certified LabVIEW Architect

0 Kudos
Message 3 of 6
(3,504 Views)
Hi all,  I am facing a similar problem.
I am using Labview 7.1, LabSQL, MySQL.
 
See the pic below.
 
What I want the program to do is:-
1) write 6 values, altogether with SN (serial number) and timestamp with auto-increment testID in the table
2) query to get testID based on SN and timestamp.
3) continue to write 5 tables with testID.
 
When I run the test, I manage to write only one first table and the other 5 tables did not show changes.
What could it have gone wrong?
 
Pls see the attached.
 
pls help thanks.
 
0 Kudos
Message 4 of 6
(3,237 Views)
Sorry Forget to mention the  name of main LV running.
The name is  test_standalone_data_inserter and  ini0.ini file is inside the previous zip.
 
 Oh dear I forget database too. Pls see the attached.
 and pic attached. see below
Thanks  again
Clement
0 Kudos
Message 5 of 6
(3,235 Views)

Astroboy,

 

This code is very messy in its current state.  I recommend simplying it down, using modular programming (with subVIs), highlight execution, and probes to see if the correct values are being passed.  It is very difficult for others to sit down on a completed application and attempt to pinpoint a specific portion of code that is giving you the issue.  You may get lucky a few times, but a lot of times users will stray away from diagnosing messy code.  If you can use diagram disable structure, and narrow down the issue to a smaller portion, you may have better luck in pinpointing the issue.

0 Kudos
Message 6 of 6
(3,192 Views)