10-04-2011 07:21 AM
Hello Friends,
I need to do .exe file for my LabVIEW program. In my program I need to access the MS Access database file (i.e. one UDL and one MDB file) which I created for my project in my system. I am having application builder. I need to add database to .exe file.
I did the .exe file but when i am running the application in one more system which is not having LabVIEW, I can't read the data from database file (MS Access). I tried with INSTALLER also. The problem i identified that the locations of the UDL file in my system and in the other system is different. So how to link the the database path in .exe file.
10-04-2011 08:08 AM
Is the database file in the project? If so, you can include it from the Source Files page. Add it to the "Always Included" list. When you build the application the .mdb file will be placed into the "data" subdirectory next to the application.
10-04-2011 11:17 PM
Thank you for your reply.
Yes i did that. Still i am not getting the data.
10-05-2011 12:50 AM
Once check the program to know the path I mentioned(see the attachments).
In Lab.udl, database name in connection tab is C:\Documents and Settings\ravi\Desktop\Lab.mdb and both .udl and .mdb files at my desktop.
After that I added these two files to project. Then I placed in ‘always include’ in ‘source file’ option. Then I build the project. This .exe running in my system but when I am moving this application to other it is not working.
10-05-2011 07:53 AM - edited 10-05-2011 07:54 AM
Do not use hard-coded paths like that in your code. How do you know the computer where you are going to be running this VI is going to be Windows XP, which has a C:\Documents and Settings? On Windows 7 that directory doesn't exist is not directly accessible. Also, if someone else runs it, they won't be able to access that directoy. Either provide a path control (not an indicator) to allow someone to select the file, or set the path relative to the application's location. Note that if you use the Current VI Path to determine relative location (such as it being in the "data" subdirectory) be aware of this: Why Does My Executable Not Work When Using the Current VI's Path Constant?