LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Database query problems

Hi there,

 

So a while ago i asked about this ID key and mysql but ive got that sorted and have a working database. However i am installing the exe on other computers and some are working and others arent.

 

datas.JPG

 

In Column 3 is the computer name. So it works on different computers but with some you are getting this error:

 

datas3.JPG

 

Here is the full text of errordatas4.JPG

 

I have set up the odbc exactly the same on my pc, the pc that is working on the production floor and the ones that aren't working. Why is it im getting this error on certain machines and not all of them? I have attached the VI's (I know they are messy and ill clean the wiring up once its all finished and working on every machine).

 

Kind Regards

0 Kudos
Message 1 of 7
(3,638 Views)
I am on my phone and can't look at your code but here is a couple hints:

Have you tried googling "0x80020009 ADO"? You might get some clues there.

Is there any correlation between the names that don't work and the name formats?

Part of the problem here is that you are using the DCT, which at times can hide the real reason for errors. I've always found it better to interact directly with the ADO layer and learn a little SQL -- it's really not very hard.

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 2 of 7
(3,600 Views)

Hi Mike

 

Thanks for the reply. I have searched the error and its talking about follows:

"ADO Error 0x80020009 refers to an EOF, of sorts. It essentially means your query returned no results or you reached the end of your record set."

 

All i'm trying to do is insert the data that is on the pc's onto it without actually having to manually enter it. I have tested multiple times on my pc and the code works perfectly fine. I never get this error message. I tried it on a pc downstairs and again it worked fine. Then i tried putting it onto multiple computers and then started getting issues. But regardless it still works on the computers that worked. 

 

I have a solution if i cant get a fix for this however it just means copying the logs from one pc to a working one to then send them over.

 

I wouldnt say so, the names all vary, all that i can think is that there might be a permissions issue and its not allowing the computer to run correctly. 

 

So what instead of using the insert DCT use the SQL function of insert into? Wouldnt i still need to use the DCT to run the query of insert into?

 

Kind Regards

Colin 

0 Kudos
Message 3 of 7
(3,573 Views)
No, the DCT is not needed. ADO is an ActiveX function and so can be accessed as you would any other ActiveX recource on your computer. I have posted alternative drivers on the forum.and my blog. Here's a link to the first of a series of posts I did on databases, links to the drivers are in the post.

http://www.notatamelion.com/2015/01/05/managing-data-the-easy-way/

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 4 of 7
(3,564 Views)

Thanks for the reply,

 

Yeah you were right about the DNS and the work blocking it... Typical. But i have read in your blog what you posted, however i am just a little bit stuck in terms of how i can write the data.

 

Obviously i am looking to do an Insert Into statement, but the data isn't set values every time. I am wanting to take from a log file and split it all up and append it accordingly. Would i have to use Create and Read Recordset and for the source just co-cacenate the string with the data from the selected columns/rows?

 

 

Is there no way to have the ADO pretty much in the same setup as the DCT so dont need to spend more time on re-adjusting the vi's? Seems a lot of work to try and work around the issue when i have it working at my desk, and on 2 production floor pc's? Just for seome reason the second i roll it out onto all of them the parameterized query fails.

 

Kind Regards

Colin

 

 

 

0 Kudos
Message 5 of 7
(3,521 Views)

DCT = Database Connectivity Toolkit

 

for the acronym-impaired folks like me

 

 

0 Kudos
Message 6 of 7
(3,504 Views)
The thing to remember is that SQL statements are just strings. Consequently, you can create string like:

INSERT INTO myTable (myNumber) VALUES (%d);

And the use format to String to insert the data at runtime.

You also want to give some careful thought to the datatype you are saving. For example a waveform can consist of hundreds of numbers, but you don't want to save it that way because logically, it's just one value.

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 7 of 7
(3,488 Views)