LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mysql without odbc call library function node

hy!

 

i'm trying to send a SELECT query to a mysqlserver by calling the needed functions in libmysql.dll

 

i get a successful connection and can read the server-version, but the result of the query which should be something like DATETIME|INT|INT and so on is quite a mess:

 

“À›ÀŸÀ2012-02-13 08:40:46

 

I read in the documentation of fetch_lenght, that this function should recieve an array, but how can i tell a Call llibrary function node to return a array?

MySQL_fetch_lengths

 

 

libmysql.dll  i used: mysql-connector-c-noinstall-6.0.2-win32.zip

 

Untitled.png

0 Kudos
Message 1 of 7
(4,404 Views)

Is there a reason you are going about this the hard way with the dll instead of the database connectivity toolkit or any one of a number of free options for using standard SQL? I doubt that you will find many (if any at all), that have tried your approach.

0 Kudos
Message 2 of 7
(4,378 Views)

I used the DBToolkit in the first way but it should be a executable wich can be used without installing  any other software (ODBC e.g.). I also tried the solution from SAPHIR but this one is extremly slow with large querys. It should also work as 32 and 64 bit executable

 

I read something about using the Call library function node with LabVIEW instad of a DLL but i can't geht it working.

https://decibel.ni.com/content/docs/DOC-9091

 

0 Kudos
Message 3 of 7
(4,370 Views)

So instead of installing the small odbc driver, you would rather install the dll? And, you would need to support both 32 and 64 bit dll's. Sorry, I can't help.

0 Kudos
Message 4 of 7
(4,365 Views)

How to read a function return pointer that is an array, can be seen here. Kind of messy I know, but interfacing C is a mess in comparison to LabVIEW programming.

 

For the rest I think I fully agree with Dennis. Lots of sweat and work for a questionable benefit. And your strange data probably comes from binary and text data being mixed in the returned pointer based on the column datatype. Good luck with creating a LabVIEW VI library that can handle that transparently.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 7
(4,354 Views)

One possibility could be to open a TCP connection to mysql and send queries / commands via that.

I did this with some success many years ago. Unfortunately I no longer have access to the code.

It'll still be considerably more work than using odbc though.

 

Good luck!

 

0 Kudos
Message 6 of 7
(4,340 Views)

did you make it work?

what was the result?

Can you share your final VI?

 

Thank you.

0 Kudos
Message 7 of 7
(3,870 Views)