Managing ADO warnings

  • Thread starter Thread starter Atlas
  • Start date Start date
A

Atlas

Is there a way to manage in the .adp VB code the ADO warnings?

Example:

If you try to delete a record that conflicts with cascaded deletes rules you
get an error like "DELETE statement conflicted with COLUMN REFERENCE
constraint ....." bla bla bla.

Any hint ? I undesrtand you could go for a query-before-delete approach
but......
 
Personally, I prefer to use a series of delete statements enclosed in a
transaction inside a SP; so I don't know the answer to your problem.
However, it is possible that the OnError event for the form will react to
this error.

Managing error messages of SQL-Server from ADP has always be problematic.
 
Personally, I prefer to use a series of delete statements enclosed in a
transaction inside a SP;

Hi Sylvain, talking about SP within .adp: I'm using only one in the whole
project due to the complexity of the query; it looks like it takes little
longer to start (we're talking about a perception of milliseconds!) but once
started it bursts data in the form. Do you state the same beheaviour?
 
There are too many factors involved here to give you a miracle recipe. You
should read some books about optimizing SQL-Server.
 
Is there a way to manage in the .adp VB code the ADO warnings?
If you try to delete a record that conflicts with cascaded deletes
rules you get an error like "DELETE statement conflicted with COLUMN
REFERENCE constraint ....." bla bla bla.

Use the following code:

DoCmd.SetWarnings False
(your code here)
DoCmd.SetWarnings True

I suggest also an error manager where, in case of errore, you execute the
following line of code:
DoCmd.SetWarnings True
 
Back
Top