LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Related links

Check out our Database and File IO Code Repository Files or visit the LabVIEW Wiki Database and File IO articles.


Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> MySQL and LabVIEW 6.1
nyc10036
post Dec 13 2004, 07:09 PM
Post #1


3 more posts to go!


Member
Posts: 7
Joined: 13-December 04
Member No.: 1228
LV:6.1
United States


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?


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Dec 13 2004, 07:09 PM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
Michael_Aivaliot...
post Dec 14 2004, 12:40 AM
Post #2


Confucius say: Crowded elevator always smell different to midget
Group Icon
*****

Admin
Posts: 2363
Joined: 13-October 02
From: Planet Earth
Member No.: 2
Using LabVIEW Since:1994
LV:8.5 ,8.2.1 ,7.1.1
Greece Canada United States My Blog My Gallery


QUOTE (nyc10036 @ Dec 13 2004, 03:09 PM)
Recently, I am trying to do the same with MySQL.
*

What method are you using to communicate with your database?

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
snooper
post Dec 14 2004, 12:46 PM
Post #3


Active
*

Member
Posts: 17
Joined: 11-June 04
From: Netherlands
Member No.: 459
Using LabVIEW Since:2008
LV:7.1 ,8.0.1 ,7.0
Netherlands Nothing Selected Nothing Selected


QUOTE (Michael_Aivaliotis @ Dec 13 2004, 07:40 PM)
What method are you using to communicate with your database?
*


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


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
nyc10036
post Dec 14 2004, 03:13 PM
Post #4


3 more posts to go!


Member
Posts: 7
Joined: 13-December 04
Member No.: 1228
LV:6.1
United States


QUOTE (Michael_Aivaliotis @ Dec 13 2004, 08:40 PM)
What method are you using to communicate with your database?
*


I am using a DSN-less connection.

I am attaching my VI.

I do not get an error, but the RecordCount returns a -1.
Attached File(s)
Attached File  LV_mysql.vi ( 37.62K ) Number of downloads: 358
 


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
snooper
post Dec 15 2004, 10:30 AM
Post #5


Active
*

Member
Posts: 17
Joined: 11-June 04
From: Netherlands
Member No.: 459
Using LabVIEW Since:2008
LV:7.1 ,8.0.1 ,7.0
Netherlands Nothing Selected Nothing Selected


QUOTE (nyc10036 @ Dec 14 2004, 10:13 AM)
I am using a DSN-less connection.

I am attaching my VI.

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


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!
Attached File(s)
Attached File  LV_mysql.vi ( 38.03K ) Number of downloads: 354
 


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
nyc10036
post Dec 16 2004, 03:33 PM
Post #6


3 more posts to go!


Member
Posts: 7
Joined: 13-December 04
Member No.: 1228
LV:6.1
United States


Arnoud,

thanks very much.
setting the CursorLocation for the Recordset before opening is the key smile.gif

also, in LabVIEW 6.1, I found that if the Recordset has NULLs in any field,
the Invoke Node -> GetRows will not work


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 




Time is now: 22nd November 2008 - 10:30 AM