From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can anyone tell me the solution to add the database file to project and how to do the .exe file after that?

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. 

 

 

 

0 Kudos
Message 1 of 5
(2,754 Views)

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.

0 Kudos
Message 2 of 5
(2,748 Views)

Thank you for your reply.

 

Yes i did that. Still i am not getting the data.

0 Kudos
Message 3 of 5
(2,742 Views)

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.

 

Download All
0 Kudos
Message 4 of 5
(2,738 Views)

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?

0 Kudos
Message 5 of 5
(2,729 Views)