LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is there a way to verify a database write?

Solved!
Go to solution

I am writing to a access database but get inconsitent writes. 

Sometimes it is written, sometime not without any way of me knowing when this will happen.

 

I am able to double check the write afterwards with Access but I woul like to programatically confirm that I have written to the database.

 

The Setup: access 2007 connected via ODBC over a local network.

 

attached is a simple vi to insert text data to a table in the database "testDataBase"

testdatatxt.png

0 Kudos
Message 1 of 8
(2,906 Views)
Solution
Accepted by topic author BeanBoy

You have two choices:

 

1. Don't use the connectivity toolkit. It throws away errors.

2. Try to read back the record after you have written it.

 

Also make sure that your code can propegate errors and report them when they occur.

 

Of the two choices, my preference would be Number 1.

 

Mike...

 

PS: Check here for an alternative...


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
(2,878 Views)

If you are using acccess then you are using very complicated way for writing. Why not using udl file?

 

After writing if there is no error and read it back is 2 options

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 3 of 8
(2,867 Views)

@mikeporter wrote:

You have two choices:

 

1. Don't use the connectivity toolkit. It throws away errors.

2. Try to read back the record after you have written it.

 

Also make sure that your code can propegate errors and report them when they occur.

 

Of the two choices, my preference would be Number 1.

 

Mike...

 

PS: Check here for an alternative...


3 actually, you can use Transaction, which should be self verifying.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
Message 4 of 8
(2,858 Views)

Hi Yamaeda,

                      Can you elobrate

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 5 of 8
(2,846 Views)

Database transactions can be useful for ensuring that multiple database modification occur atomically, but they won't help with the OP's original problem which is that errors don't seem to be reported.

 

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 6 of 8
(2,824 Views)

How it can be useful for verifying database write?

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 7 of 8
(2,790 Views)

I will use my current situation as an example.

 

I am writing data to tables in a database for testing of a piece of instrumentation. This data will later be used for statistical analysis on the quality of the instruments and verification of design stability.

Issuing an insert command does not guarantee and actual write to the database in my situation. Thus I must verify that it is written correctly. The database Connectivity toolset should be reporting errors yet it is not.

This causes uncertainty in the data collected as there are missing pieces of data.

 

I have for testing purposes implemented the 2nd option, to try to find the unique keys I have issued to the database. If they exist that is proof that data has been written.

The unique keys come from linked tables.

 

I would like to attempt to implement the first option from Mikeporter. But it will take more time to test and I have been tasked with other duties. Hopefully in a week I have completed my testing and can implement it.

0 Kudos
Message 8 of 8
(2,774 Views)