I have created a datalogging app but I have had no joy at all trying to write the data to a database.
The small vi attached creates a database in c:\DBase\ and then you can write data into it. I get no errors at all from this code but the database remains empty.
I am using Windows 10 64bit, LabView Pro 2016 32 bit and currently SQL Server 2016 32bit. I have tried a few versions of SQL server, the server is running and appears configured ok.
If anyone can spot an error in my app or can confirm this works ok on a different version of LAbview or SQL then it would help greatly.
Solved! Go to Solution.
Thanks for replying Sam.
The database create was easy to get working. I then used an example vi I found to create a table in the database, in my vi when it writes the data I also have it reading the column headers out from the database.
In the image I have created a database, the path and connection string are displayed. Then in the lower area I have saved the data stored in the readings matrix along with some other info. There are no errors from either process.
You can see the column headers read from the database match the column headers I am sending data to.
I should also say I am using Access to look for data within the database.
First of all, you have Data to Variant, no need for that. Wire the cluster directly input the DB function.
How are you getting data out of the .mdb file?
I have now sent the data direct, no more variant but no change to the outcome sadly.
I am using access to check if data is present, also I see the file size does not grow no matter how many times I save data so I feel sure the data doesn't make it.
I am concerned that opening the database in access may ruin it for labview. If I open and save a spreadshet in excel labview will no longer work with it. I don't know if I will have the same problem with access, it does increase the file size from 80kb to 228kb simply by opening the file, no saving, just open and close the file and it grows.
For now I can simply create another database file each time until I see data being saved.
OK I have this sorted now. Should be 'insert' not 'update'
Too embarassed to say how long I looked at this problem
Thanks for the help.
Onwards and upwards