Jump to content

MySQL and LabVIEW 6.1


Recommended Posts

I've been in the past able to read/write from Microsoft Access database.

Recently, I am trying to do the same with MySQL.

I have read the PDF file from this website.

I am having trouble with the basic of just using a SELECT * query.

I want to see the data returned.

I can't figure out how.

Anyone who has done this?

Link to comment
What method are you using to communicate with your database?

3005[/snapback]

Hi,

You should try creating a connection to the MySQL server using a DSN connection, this means you create a Data Source Name to your MySQL server that contains all the necessary connection information.

You can create a DSN in every Windows based pc by opening the "ODBC Administrator" in your "control panel". If you name your DSN "LVMYSQL" than you can open a connection in LabVIEW by using. "DSN=LVMYSQL".

If you are interested in a more easy way, consider upgrading to LabVIEW 7.0 or higher. We have created a Database Toolkit that allows you to easily connect to a database using Express VI technology, you can also create queries without having to know SQL.

On of the most import features is the automatic creation of the appropriate clusters and arrays, this according to the retrieved information from the database.

Conversion like varchar to string, and float to double are already created for you!

Have a look at: http://www.tm-solutions.nl/eng/produkten/produkten.html T&M Database Wizard for LabVIEW

If you have any other questions, please do ask!

With kinds regards,

Arnoud de Kuijper

T&M Solutions BV

Link to comment
I am using a DSN-less connection.

I am attaching my VI.

I do not get an error, but the RecordCount returns a -1.

3017[/snapback]

The attached VI show a correct connection code, but their are 2 options that could cause problems:

1) The Recordcount property is only usable when you can fully lock the recordset (set the correct locktype and cursurtype options). Otherwise the result always will be -1, but you do can read the records in the recordset!

2) This is the most likely problem: MySQL does not use an Cursor Location, you have the options: adUseNone, adUserClient, adUseServer. If you sets the Cursor Location before you open the recordset you do can retrieve the RecordCount Value.

I have attached the new LV_mysql.vi with the new appropriate code, I do not have a MySQL server installed so I cannot test the code.

If you are still experiencing problems, please do ask!

Arnoud de Kuijper

T&M Solutions BV

T&M Database Wizard for LabVIEW!

Download File:post-459-1103106591.vi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.