Managing ADO warnings

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......
 
S

Sylvain Lafontaine

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.
 
A

Atlas

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?
 
S

Sylvain Lafontaine

There are too many factors involved here to give you a miracle recipe. You
should read some books about optimizing SQL-Server.
 
G

Gabriele Bertolucci

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top