From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-11-2020 07:18 AM
Hi,
currently I am writing data from LabView to a MySQL server using an ODBC data source. Problem is (since now): I need the user to NOT be able to read my database. But everyone, who has access to the machine, should be able to just reference the ODBC data source (which I created for LabView) for any application and have access to my data, correct?
Is there a way to store my DB credentials somewhere safe (like "in the LabView code")? If so, how would I do that? I've heard about UDL files, but those are plaintext and have to be stored somewhere on the disk...
Thank you for any advice
Martin
Solved! Go to Solution.
08-11-2020 08:17 AM
The Connection string that's stored in e.g. a .UDL can be wired directly to Open DB Connection.
08-11-2020 08:20 AM
So what you're saying is:
Create UDL File, open with editor, get content and paste into "string constant" in Labview ?
08-11-2020 09:26 AM - edited 08-11-2020 09:39 AM
Just as additional information, here is how it is working for me (of course, the MySQL ODBC driver has to be installed)
Addendum: It seems to be important to include "Option=3;" in the string for some reason (that is not in my picture)
06-09-2022 07:37 AM
Thank you. Your additional information helped me a lot.
06-09-2022 08:31 AM
@mw42 wrote:
I don't know about MySQL specifically, but the VI shown in this image has inputs for the user ID and password which it passes to the ADO Open method, so it should certainly be possible to put the password in the VI and use a UDL (without saved credentials) to point to the relevant DB.
The big advantage of this is that you can then modify the UDL file or use another UDL file if you want to point to a different DB (e.g. a staging environment vs. production or a situation where you might have multiple servers).
Even if that didn't work, it would also have been possible to edit the connection string in code and have parts of it come from an external config file and parts of it be stored in the code.