2009-03-23

Hide Make-Query Confirmations in Access?

I've been working on extracting data from a Sybase database on a machine with only Access and ODBC drivers, lately (off in an isolated environment lately). We're using Access as a medium to snapshot the data--and migrate it to SQL Server for long-term storage. Well, long story short, I have several dozen Make Queries that are extracting this data into physical tables, and I'm trying to wrap the Make Queries into a Do-All Button. Unfortunately, each Make-Query asks a bunch of silly confirmations that read something like "You are about to create a table with 8196 rows". Considering I have 200+ Make Queries that I'll need to run a few times before all's said and done, typing Alt+Y for half an hour isn't my idea of fun.

I proudly present to you...

DoCmd.SetWarnings False

DoCmd.OpenQuery "Name of Query 1"
DoCmd.OpenQuery "Name of Query 2"

DoCmd.SetWarnings True

Yup, this VB script is being used to complete this task. I'll be creating a module with a single method and invoking somewhere from the app. Wee. Zoidberg away.

No comments: