LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Linking .udl file to .mdb or .accdb in programming

I`m working on the database toolkits. I can manually create an .udl file andlink to .mdb or .accdb file. Can this be done through programmatically from LabVIEW?

0 Kudos
Message 1 of 19
(4,543 Views)

Why dont you use two different udl file.one for mdb and one for .accdb and connect to them accordingly as per your requirement?

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 2 of 19
(4,543 Views)

Hi Ranjeet, 

I`m not using two different extension files i`m using either .mdl or .accdb file for an single .udl file.

 

 

Let me be more clear here I`m linking an test.udl file with the test.accdb. I can manually link the file by selecting the OLED function and specifying the path but I need to do this in program so every time when I run the program I can retrive those data if I have entered already.

0 Kudos
Message 3 of 19
(4,532 Views)

@gnshmrthy wrote:

Hi Ranjeet, 

I`m not using two different extension files i`m using either .mdl or .accdb file for an single .udl file.

 

 

Let me be more clear here I`m linking an test.udl file with the test.accdb. I can manually link the file by selecting the OLED function and specifying the path but I need to do this in program so every time when I run the program I can retrive those data if I have entered already.


The UDL is a text file, which you'll see if you open it in Notepad.

However, as suggested, it's alot easier to use 2 UDLs and choose/select between them.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 19
(4,531 Views)

I gave up using UDL files a long time ago.  I find it so much easier to use connection strings.  You'd be able to build the connection string any way you need.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 5 of 19
(4,511 Views)

UDL is essentially a connection string. It has the connection information and all the same info in a connection string. If you open a udl file, you will see all the connection info as in the connection string.

0 Kudos
Message 6 of 19
(4,502 Views)

To be very clear mdb comes into picture when you are working on office 2003 and other when office 2007. Then what I suggess is to use mdb file all the time as it will be compatible with office 07 also but not accdb file and it will solve your problem of switching.

 

Hope this help.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 7 of 19
(4,479 Views)

@gnshmrthy wrote:

 I can manually create an .udl file andlink to .mdb or .accdb file. Can this be done through programmatically from LabVIEW?



Yes, since it's a normal textfile, is the short answer, the longer answer is to look at the tips and comments above. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 19
(4,469 Views)

The fundamental point that you seem to be missing is that you don't need the udl. What you need is the connection string that is inside the udl. So if you are going to generate the string on the fly, why waste the effort to write it to a file. As has already been suggested, use the connection string directly.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
Message 9 of 19
(4,458 Views)

yes mike is also right. For accesing the mdb file you dont need udl file. See this

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 10 of 19
(4,450 Views)