Michael Beck
Michael Beck

Reputation: 2845

How to query access table with a subdatasheet that requires parameters

I have been tasked with creating a method to copy the contents of an entire database to a central database. There are a number of source databases, all in Access. I've managed to copy the majority of the tables properly, 1:1. I'm using VBScript and ADO to copy the data. It actually works surprisingly well, considering that it's Access.

However

I have 3 tables that include subdatasheets (to those that don't know, a subdatasheet is a visual representation of a 1 to many relationship. You can see related records in another table inside the main table). When My script runs, I get an error. "No value given for one or more required parameters." When I open Access and try to run the same query that I've written in SQL, It pops up message boxes asking for parameters.

If I use the query wizard inside Access to build the select query, no parameters are required and I get no subdatasheet in the result set.

My question is this: how do I write a vanilla SQL query in my VBScript that does not require parameters and just gives me the data that I want?

I've tried copying the SQL from Access and running it through my VBScript and that doesn't seem to do the trick.

Any help is greatly appreciated!

Upvotes: 0

Views: 680

Answers (1)

Michael Beck
Michael Beck

Reputation: 2845

As it turns out, you need to make sure that you've spelled all of the field names properly in your source query. If you've included additional fields that aren't actually in the source or destination table they'll need to be removed too.

Upvotes: 0

Related Questions