LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to update single row of ms access database

Hi All,

 

can somebody tell me how can i edit/update a single row of ms access database?

 

Untitled.jpg

 

let say i want to edit the first row of the figure in the left. What i want is when i click in the row, it will pop up a window where i can edit the fields content. or may be is it possible to add a column with "edit" text which link to the appropriate row. so when i click the "edit" it will open the edit window.

 

Thank you

0 Kudos
Message 1 of 8
(4,588 Views)

If you use a multi-column listbox indicator there is a "double-click" event that you can capture with an event structure. The event, when fired, returns the row that the user double-clicked. Use that parameter to fetch/modify the data as needed. Remember that to update the data in the database the table containing the data must have a primary key - or at lease something you can use to uniquely identify the rows.

 

Remember that in a database, there is no such thing as "the first row"; you have to explicitly identify which row you wish to modify.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 8
(4,568 Views)

I didn't use multi-column list box, i need to add double click event for my table. The table contains fetched data from ms access database. The problem now is i don't know how to create a VI which will display the current row.

0 Kudos
Message 3 of 8
(4,544 Views)

It will be far easier to simply replace the table control with a multicolumn listbox as Mike suggested than to try to monitor for a double-click event for a table control. All you need to do is that instead of writing directly to the table you write to the Item Names property.

 

If you insist on doing things the hard way, then you'd have to monitor the Mouse Down event and check the time between the current Mouse Down and the previous Mouse Down. If they're close enough, then you can consider it a double-click. All of that code ...

 

What is the issue with creating a VI that displays the current row? You just need a "popup" dialog to which you feed it the current row as a 1D array of strings. There's lots of examples on making popup VIs.

0 Kudos
Message 4 of 8
(4,540 Views)

I try to use the multi column list box but it won't retrieve the database. I'm very new to programming, so i'm sorry if i ask such a stupid thing.

 

Untitled.jpg

0 Kudos
Message 5 of 8
(4,534 Views)

You're really talking about 2 different things here. Are you actually getting data from the database? In other words, is there data on the wire coming out of the SQL Execute VI? Have you put a probe on there? If you have no data, then you have nothing to write to the multicolumn listbox.

0 Kudos
Message 6 of 8
(4,529 Views)

Of course i have the data from my ms access database. i can retrieve the database when i use table. but when i use multi column list box it won't retrieve the database.

0 Kudos
Message 7 of 8
(4,515 Views)
You need to write a VI that does nothing but retrieve your data from the database and return it as a 2D array of string. Now you write that array to the listbox's Items property and it will be displayed.
How it is displayed has nothing what so ever to do with how it is fetched.
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 8
(4,512 Views)