Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to write a program that is linked to Access!?

Status
Not open for further replies.

lklkl

Technical User
Oct 8, 2001
2
MY
Say I have 3 tables in Access which are Supplier Details, Trasaction Details and Item Details. So here goes the question:

1. How to write the code snipet to ensure that the new Supplier ID or Supplier Name entered doens't exist in the database? Plus an error message should be flashed if the Supplier ID/name already exist.

2. How to ensure that the Item Code and Supplier Code are present in the appropriate tables before letting a new Transaction to take place (to add a new transaction to Transaction Details).

3. How to write the code to ensure data integrity. Say if a Supplier ID is modified, then the Transcation database will be updated. Either update the changes made to the Supplier ID, or delete the records that are link to the deleted Supplier.

I'd be very happy if I could get some helps. Thanks a lot :)
 
Dear lklkl,

Data integrity should allways be handled by the database itself.
1) You can make a table's field a primary key,
or you can query the given table with the criterions to meet supplier ID and/or Name if do not get records back the record is not yet entered.
2 and 3) You can configure the relation in access with referential integrity with cascading update and/or casading deletion

HTH regards Astrid
 
What kind of connection are you using? I can provide snippits with ODBC, and general answers if its ADO or COM

CJB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top