Return message based on query result

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Bruce (anonymous_at_discussions.microsoft.com)
Date: 05/20/04


Date: Wed, 19 May 2004 20:26:04 -0700

How do I you code to give some meaningful error message based on a queries result. I have 2 situations to that I would like help on.

I have a series of select queries that essentially are checking data intergrity in my database. (n.b. Not referential Integrity).
Essentially, if the query result is NULL then integrity is intact. However if not then the records with discrepancies are returned.

rather that open all these queries and view myself, is there a way to do this from code that basically tells me which queries are in error.

e.g.
if qry_integrity is not null then
msgbox("There are integrity issues".)
End
Else
msgbox("Ok")

The second I would like to do I add some code to a macro that runs an into into (Append) query). I have turned off set warnings.
Basically is the append is successful it should tell the use "Record added successfully". If not "The record could not be added".

Any help appreciated

Bruce



Relevant Pages

  • Re: Table Analyzer and Normalization
    ... schema via update queries - while still maintaining referential integrity. ... > you could put one over on your DBA and install MySql somewhere. ... in fact installed MySQl and an evaluation copy of SQl server too. ...
    (microsoft.public.access.tablesdbdesign)
  • Limit a combo box to certain options
    ... integrity. ... The orders table is where all of the order info is stored for each item ... I use this table for all of my queries and reports. ...
    (microsoft.public.access.forms)
  • Custom querys - ORDER BY clause?
    ... simple asp page with a seach form and parameters that ... queries an Access2002 db. ... successful but runtime viewing produces a "The operation ...
    (microsoft.public.frontpage.programming)
  • Re: Full text indexing with Japanese characters problem
    ... I did some other tests with english and they all seemed successful ... queries I made...Could there be missing words, ...
    (microsoft.public.sqlserver.fulltext)