LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a UDL programmatically

I am trying to create a UDL automatically. The attached VI does just this but the UDL generated could not be used. I used the content of an existing UDL bar the different database path.

Please help.
0 Kudos
Message 1 of 13
(5,700 Views)
Hello There
The best way is to use oryginal "Report generation toolkit" vi to create dlls. Dig into the report generation and find out how to do this. If you can't post again, maybe I can help.

regards
Pawel
0 Kudos
Message 2 of 13
(5,700 Views)
And just a littel comment more.
As I can see you are trying to fill the UDL content by a standard text characters. That is probably what you have seen in the Windows explorer.

You must know that UDL files are not a standard text files but unicode files, which means that every character consists of two bytes (if I am not wrong).

Again the best method is to use oryginal UDL files.

regards
Pawel
0 Kudos
Message 3 of 13
(5,700 Views)
Hi
 
It is possible to create a UDL file on the fly. This example show how to connect to a local "MS SQL Server 2005 Express" with a "Windows Authentication" login.
With this login I can create another login/user with restricted permissions, create new databases or what ever I want to.
 
I hope it usefull 🙂
 
Vh Ebbe
Message 4 of 13
(5,417 Views)

Ebbe,

Can you possibly send this to me in Labview 8.0 format somehow? I cant open it in the current form...

I am very interested in this since I have to create 30 MS Access dB udls on the fly from a server dir listing.

ID

0 Kudos
Message 5 of 13
(5,288 Views)
Ebbe hasn't been on these boards since April, so here you go in 8.0. Note that the VI uses a couple of VIs from the Database Toolkit (or whatever it's called nowadays). However, this is just to test the connection. The creation of the UDL occurs before this.
0 Kudos
Message 6 of 13
(5,281 Views)

thanks alot. 

 

I must ask a stupid question...

The VI is failing when trying to open the windows registry key for SOFTWARE\Microsoft\Microsoft SQL Server.  It gives me an error -603 the windows reg key that you are trying to open does not exist.  Sounds self explanatory, but I am looking for the MS Access Server Key I believe.

Any thoughts would be helpful..

 

 

0 Kudos
Message 7 of 13
(5,279 Views)
Well, you would need to replace it with the correct key for Access. I don't have Access installed, so I can't verify what the key should be. My guess is that it would be "SOFTWARE\Microsoft\Microsoft Access". You would need to verify this by looking in the registry, though.
0 Kudos
Message 8 of 13
(5,275 Views)

Thanks again.

When doing it manually, I set things as shown in the Data Link Properties.jpg.  My registry looks like the registry.jpg file.  

My data link that I want to create is a MS ODBC one that I think is this registry key

"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ODBC".

 

But now I am getting the same error -603 on the next VI when it tries to read the default value.   Will this VI work for this application knowing what we know now?

 

Download All
0 Kudos
Message 9 of 13
(5,267 Views)

One way I have done it in the past is to look for a UDL if it was missing, Create the temp.udl file and call the command line with "cmd /c path/temp.udl" whete the path is the path to the temp file.  This will bring up the windown udl config window.  this is not a silent method but works with almost no extra coding.

 

Paul 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 10 of 13
(5,260 Views)