09-16-2013 06:39 AM
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?
09-16-2013 06:42 AM - edited 09-16-2013 06:44 AM
Why dont you use two different udl file.one for mdb and one for .accdb and connect to them accordingly as per your requirement?
09-16-2013 07:52 AM
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.
09-16-2013 07:55 AM
@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
09-16-2013 11:39 AM - edited 09-16-2013 11:40 AM
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.
09-16-2013 02:15 PM
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.
09-16-2013 09:46 PM
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.
09-17-2013 01:42 AM
@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
09-17-2013 06:56 AM
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...
09-17-2013 07:23 AM
yes mike is also right. For accesing the mdb file you dont need udl file. See this