Click to See Complete Forum and Search --> : Running SQL queries


yaronb
April 25th, 2001, 02:44 AM
I am running an SQL query in an Access 2000 database, using the DoCmd.RunSQL "INSERT INTO ...." command.

The SQL INSERT query is executed without any problems, but I would like not to get the message box that prompts the user to confirm the operation. ("You are about to append..." , "Microsoft Access can't append all the records...").

Is there a way to programmaticaly answer "Yes" to all of those questions?

Thanks,
Yaron.

Iouri
April 25th, 2001, 07:25 AM
You can either turn off warning messages in Acces or use the code

DoCmd.SetWarnings False(true)

This is a VBA call. In Access, this will turn off system warnings, such as "1000 records will be deleted" -
it acts as if you select the default (hit enter) at each of these prompts, allowing your code or macro to run
without user intervention.




Iouri Boutchkine
iouri@hotsheet.com

cvdnest
June 1st, 2006, 07:21 AM
If you are using an ADO to execute the access queries from in VB, what command can be used not to get the warning messages? The code for the ADO execution is: cmdAccess.Execute , , adasyncexecuteThe problem I have is that my execution from VB seems to cancel when the warning message for access appears. If there is no warning message my query executes and data is inserted into the sql table.
as far as I know ADO command objects should not have a problem with warning messages from Access.

can anyone help me please, this is quite urgent?