LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a program that uses a DB to be shared

I want to create a labview program that uses the db connectivity toolkit to insert data into an access db. I then want to create an installer and insert the db in the installer so that I can install this app on multiple computers.

From what I have seen on the internet, I have to connect to the db using an address on my machine, but I want to know if its possible to do this with an address that can change among machines.

If this is possible, can someone please tell me how to do this?

Some instructions will be greatly appreciated.

Thanks.

0 Kudos
Message 1 of 30
(3,518 Views)

Does it have to be Access?  Microsoft has an express version of SQL that is free to use, can be installed on a server and is generally an all-around better dB.  I'm not sure if Access can be used on a network as easily. 

aputman
0 Kudos
Message 2 of 30
(3,508 Views)

I don't want to install it on a server, but rather distribute my app to other pcs. the db wont be the same but the app and the db structure will.

I don't know if I can use a relative path to the access db?

Thanks.

0 Kudos
Message 3 of 30
(3,505 Views)

So each application is writing to it's only local version of the dB.  You can store the db file in the same directory as the exe (or in the Data folder) and writing to it should be very simple.  You'll need to create a connection string but that can be generated dynamically within your code.  You should always avoid hard-coding paths to files and folders. 

aputman
0 Kudos
Message 4 of 30
(3,500 Views)

That's exctly what I want, but don't know how.

Could you please let me know which steps could I take to do this?

Thanks.

0 Kudos
Message 5 of 30
(3,497 Views)

https://www.connectionstrings.com/access/

 

You'll have to find one that works with the driver that you are using.  You'll notice that each connection string has a path to the dB.  This is the part that you'll generate dynamically in your code, based on the location of your EXE file.

aputman
0 Kudos
Message 6 of 30
(3,494 Views)

I was also thinking about using application directory to reference the access db, but I don't know how to use an access db, so I would really wish you could guide me.

Could you please help me?

Thanks in advance.

0 Kudos
Message 7 of 30
(3,450 Views)

I assume you have the Database Connectivity Toolkit.  If so, this is what you need to execute queries into your database.  There are examples that ship with Labview that can show you how to do this.  

 

If your question is about how to setup an Access dB, creating the various tables and columns, you're on the wrong website.  Google is going to be your friend here.  You should be able to find lots of Access tutorials online.  

aputman
0 Kudos
Message 8 of 30
(3,447 Views)

My question is on how to use the db connectivity toolkit to connect to an access db with a relative path.

I have used the connectivity db, but just once and it was a long time ago, so I don't remember on how to use it, and I've never used it with access.

Can you please help me?

Thanks.

0 Kudos
Message 9 of 30
(3,443 Views)

There are several ways to do it.  Here is one way, using the DB Tools Insert Data VI.  I picked a random connection string from the website and built a path dynamically to the mdb file.  As I said, you'll need to use a connection string that is compatible with the installed driver.  

Capture.PNG

aputman
0 Kudos
Message 10 of 30
(3,437 Views)