10-11-2011 08:17 AM
Hi All,
can somebody tell me how can i edit/update a single row of ms access database?
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
10-12-2011 06:40 AM
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...
10-13-2011 07:12 AM
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.
10-13-2011 07:49 AM
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.
10-13-2011 09:27 AM
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.
10-13-2011 11:40 AM
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.
10-14-2011 12:40 AM
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.
10-14-2011 02:22 AM