LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open .udl File

Hello,

I'm trying to open an .udl file to use the third line as the connection string in the LabSQL. Using the notepad I get this information from the file:

[oledb]
; Everything after this line is an OLE DB initstring
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=selco;Initial Catalog=selco;Data Source=STM

But if I use Labview to open the file I get something like this:
[ o l e d b ]
; E v e r y t h i n g  a f t e r  t h i s  l i n e  i s  a n  O L E  D B  i n i t s t r i n g
P r o v i d e r = S Q L O L E D B . 1 ; I n t e g r a t e d   S e c u r i t y = S S P I ; P e r s i s t   S e c u r i t y   I n f o = F a l s e ; U s e r   I D = s e l c o ; I n i t i a l   C a t a l  o g =  s e l  c o ;  D a  ta   S o u r c e = S T M

In the attachment I have included the source code and the .udl. The files missing are just the LabSQL VIs.

Celso Liermann

0 Kudos
Message 1 of 3
(2,722 Views)
It's probably a UNICODE file, where each character is represented with 2 bytes. If in LabView you show the string with '\' codes display, you should see the interleaved null bytes.
To get back to ASCII representation, you need to strip out all these extra characters.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 3
(2,710 Views)
Thank you Paolo for you advice. I fixed my bug using a simple structure.

Celso Liermann
0 Kudos
Message 3 of 3
(2,699 Views)