nyc10036 Posted December 13, 2004 Report Share Posted December 13, 2004 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? Quote Link to comment
Michael Aivaliotis Posted December 14, 2004 Report Share Posted December 14, 2004 Recently, I am trying to do the same with MySQL. 3001[/snapback] What method are you using to communicate with your database? Quote Link to comment
snooper Posted December 14, 2004 Report Share Posted December 14, 2004 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 Quote Link to comment
nyc10036 Posted December 14, 2004 Author Report Share Posted December 14, 2004 What method are you using to communicate with your database? 3005[/snapback] I am using a DSN-less connection. I am attaching my VI. I do not get an error, but the RecordCount returns a -1. Download File:post-1228-1103037155.vi Quote Link to comment
snooper Posted December 15, 2004 Report Share Posted December 15, 2004 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 Quote Link to comment
nyc10036 Posted December 16, 2004 Author Report Share Posted December 16, 2004 Arnoud, thanks very much. setting the CursorLocation for the Recordset before opening is the key also, in LabVIEW 6.1, I found that if the Recordset has NULLs in any field, the Invoke Node -> GetRows will not work Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.