LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple database editor

I am trying to find an easy database editor. Basicaly I want the editor to open the table like below but with current values

 

 

then just enter a new value anywhere on the table and press update so the table is updated in the database.

I googled for one but I couldn´t find one. Seems odd that I would be the first one who wants to edit a database trough labview.

0 Kudos
Message 1 of 13
(4,579 Views)

Hi Peter_Y,

do you need a database editor or a LabVIEW database editor? You can use a SELECT query to get your data and an UPDATE/INSERT command to write your changed data.

 

Mike

Message Edited by MikeS81 on 08-17-2009 08:38 AM
0 Kudos
Message 2 of 13
(4,578 Views)
Its going to be a part of a bigger Labview program so I need a labview one.
0 Kudos
Message 3 of 13
(4,574 Views)

Peter_Y wrote:
Its going to be a part of a bigger Labview program so I need a labview one.

 

Hi Peter_Y,

ok, where do you have problems?

 

Mike

0 Kudos
Message 4 of 13
(4,570 Views)

Well when I try to send the table back to the database unedited or edited I get this error

 

NI_Database_API.lvlib:Cmd Execute.vi->NI_Database_API.lvlib:DB Tools Insert Data.vi->Database Sample.vi<ERR>Exception occured in Microsoft OLE DB Provider for SQL Server: Insert Error: Column name or number of supplied values does not match table definition. in NI_Database_API.lvlib:Rec Create - Command.vi->NI_Database_API.lvlib:Cmd Execute.vi->NI_Database_API.lvlib:DB Tools Insert Data.vi->Database Sample.vi

 

Since I havent changed anything I find that odd.

0 Kudos
Message 5 of 13
(4,556 Views)
There should be some easy way of just opening a table from a SQL server and edit it in Labview. I must be missing something. It takes less than 3 minutes to do it in Visual Studio so it cant be that hard.
0 Kudos
Message 6 of 13
(4,525 Views)

Are you using the database toolkit from NI? I think is should be a database tool in that toolkit( some sort of simple table reader app). But I have not used it since Labview 7.0 so I am somewhat rusty regarding that tool 😉



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 7 of 13
(4,522 Views)

Dare i guess that the table is a matrix of strings?

 

My experience says that labview doesn't automatically add ' to strings so you might have to make an export function.

 

One approach is to make the table as a cluster identical to the database and work that way somehow.

 

I'm pretty sure it's a format issue.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 13
(4,521 Views)

You have three problems -

 

First - the insert VI expects a cluster with an element for each column, as mentioned in the previous post, so giving it an array won't help.

Second - the insert VI won't help you, as it inserts data into the table, whereas you want to update the table.

Third - to update a table, you need to know which row to update (the SQL UPDATE command requires a WHERE clause). Visual Studio can do this because it integrates with Jet and SQL Server, so it knows all about the table's structure. LabVIEW does not.

 

There might be some .NET control you can use in LabVIEW (e.g. you can probably bind a DataTable or DataView directly an SQL Server table), but if not, you will be forced to write some code which will need, at the very least, to know what the key to the table is.


___________________
Try to take over the world!
0 Kudos
Message 9 of 13
(4,507 Views)

Coq Rouge

Yeah that was what I thought when I started but I can´t find any. Then I thought: "There has to be an example of that, its so basic".

 

Yamaeda 

I wish there were only strings. But no there are boolean and int aswell.

 

tst

I have made a small VI that updates a table with a value using a SQL query. But with that VI I have to first choose table from a drop down menu, then what column from a drop down menu, write the RunNumber (some code taken from an example) so the the where query can find the right row then the new value. And that VI only works for strings for the moment. I have to make different kind of querys for different data types. Its a way but I woud like to just have a table where I could write a new value in the table, press enter or a update button or something and the value would automatically be updated to the database. 

 

.NET is an option I´m not very found of since I have not worked with .NET before but I will look into it. 

 

I am attaching my small update VI if anyone else finds this threads and it works for them

0 Kudos
Message 10 of 13
(4,499 Views)