LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you insert colums into any part of a Access database using the DB tools Insert vi

I only want to insert information into certain colums in my table, i can select the colums i want to insert to but Acess fills the rest of the colums with zeros. I need to tell access which colums to put data into and which to leave blank until i have data to put in them. Has anybody come across this before ?
0 Kudos
Message 1 of 6
(3,247 Views)
Look at the design of the database. Each field has a optional default value. When you define a numeric field, that default is 0. You can delete this default if you have the rights to change the database. If you don't, then when you do have data, you can do an update.
0 Kudos
Message 2 of 6
(3,247 Views)
Hi Dennis

The problem is we have to do it programatically, the zeros are not such a problem if we could get back to a specific colunm / row and continue inserting data from it.

Have tried lots of different things but carmt seem to get it working, we have 10 colunm's but write in groups of 2 colunms and 12 rows at a time.

Any thoughts ?

Paul
0 Kudos
Message 3 of 6
(3,247 Views)
Like I said, the default values in the columns are part of the database design. In order to go back, when you do the original insert, you're going to have find the index values of the new rows and use them for the update. Insert will not work since it will create new rows. I don't use the database toolkit, but when I want to update a column in a single row, the SQL syntax would be something like "update table_name set column_name = x where id = y". For another column, set specify the additional column name in the SQL statement. I'm not sure about updating multiple rows. I think it's possible but the actual syntax escapes me. A good SQL reference would be of help. Of course, your other option is to just defer the database writes until you ha
ve all of the data.
0 Kudos
Message 4 of 6
(3,247 Views)
Like Dennis said, you'll have to update records in the database. I've done something similar using the database toolkit. The attached example is a state machine design that creates a record, and after the fact will insert a report text if it is available. Check out the frame called 'Add Report Text' This code was meant to emulate the database logging that Test Stand does, but I think you'll be able to get the idea. Good luck.
0 Kudos
Message 5 of 6
(3,247 Views)
Thanks Guys

What we have decided to do is propergate 4 different types and build a query in access to bring them all together when the user wants to view them. Not as neat as using SQL but havent got to much time to finish it off.

Thanks for the sugestions and help.

Paul
0 Kudos
Message 6 of 6
(3,247 Views)