LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating MySQL DSN for labview

Hi All,
 
I was doing development in labview and MS ACCESS. And as usual i was using the udl and connectivity
tool kit to establish the connectivity.
 
As the number of records are increasing we have to use My SQLServer as the database.
 
I have downloaded MySQL ODBC 3.51 driver,And i have to access the database that is residing in the server(which is another PC).
I know i have to create a DSN.But i dont know how?
After selecting ODBC icon from the control panel,what is the next step to proceed,which tab i hav to select?and how to create the DSN.
 
Then after creating the DSN how can i access the database using labview tools?
 
Thanks in advance
 
 
0 Kudos
Message 1 of 6
(4,891 Views)
Hi,
 
I tried to create DSN by selecting userDSN tab then added My SQL ODBC server into the list and then filling the space for the server wth the IP address of the system(server),the database resides and the username and password to log into the server.
 
Now in the user DSN list the DSN i newly created appears.Is this the correct method?
 
Then how to procceed wth labview to access the data from the database using DSN?
 
Thanks once again
0 Kudos
Message 2 of 6
(4,872 Views)
Take the following steps:

  • Under the System DSN tab, click on the Add... button.
  • In the dialog box select the MySQL ODBC driver and click Finish.
  • In the following dialog you will need to enter the server name or IP address, the port number that its listening to, the name of the database that is residing on that computer, and your userid and password. If your need help with this information, talk to the person that is adminstering the database.

There may be a Test Connection button as well, but I don't have this specific client so I can't say for sure.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 6
(4,870 Views)
>> Then how to proceed with LabVIEW to access the data from the database using DSN?

How familiar are you with databases?

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 6
(4,868 Views)

Thank u so much for ur reply sir.

I created the dsn called dmu(i havent specified the port number as i have installed mysql in my pc and so its local host)

Test connection also successful.

I am ok with Labview database tool kit as i was working wth access wth the same..

When i was working wth labview and access i have created the udl and a vi to locate the udl to the current path.Now i migrated to mysql.I tried to connect to my new database using the file dsn instead of udl name.

I was trying to open the connection using DB Tools openConnection.vi which is supplied by labview and in the connection information ihave given the dsn name, dmu.dsn.But it was giving me an error as follows.

Exception occured in Microsoft OLE DB Provider for ODBC Drivers: General error: Invalid file dsn 'dmu.dsn' in DB Tools Open Connec (String).vi->DB Tools Open Connec (Path).vi->Untitled 3

Why its displaying an error like this even the test connection was successful?

Thanks in advance

0 Kudos
Message 5 of 6
(4,859 Views)
Hello user_1,

It is uncommon but not impossible for applications to return ODBC connectivity errors when the ODBC Data Source Administrator reports Test Successful!  The ODBC Data Sources Administrator is a simple connectivity tool and the nature and number of ODBC API function calls made by the utility varies from calls made by other applications that are actually trying to fully engage with a database and query it.

To address your specific problem, try to use the file DSN with an ODBC application that does not use the OLE DB data access layer. For example, can Access or Excel connect? If other applications fail to connect, you probably have a bad file DSN. If these applications connect, you may have a simple configuration problem. Try passing the full path to your file DSN to the application, e.g., C:\path\to\your\filedsn.dsn.  Additionally, check any permissions issues that would prevent the application from accessing both the DSN and the target database. If possible, try to use System DSNs or DSN-less connection strings going forward. I do not know about Labview, but I do know that file dsns can be problematic for many applications.

Best regards,
Netrista Khatam
Tech Services Manager
OpenLink Software
Message 6 of 6
(4,816 Views)