View Full Version : import query with importdata method in VB.net

01-20-2004, 07:17 AM

To import an existing query with this method works good...

Can I use SQL directly in the method?
like .importdata(database.mdb!"Select * From Table")

It didn't work when I tried...

If not , how can I create and put a query in my database with VB.NET code?

thanks for help,


Eric Frost
01-20-2004, 09:45 AM
It's been a while since I worked with it, but as I remember it was limited as you are finding. Specifically I could not pass a parameter value, I could only load set the pre-exisitng queries. The workaround I found was to write a value to a dummy table that help the parameter values.

You might be able to do something similar. If you want to construct your SQL statements on the fly and pass them in, perhaps you can create a Query object in the acccess table? and then call your query object.

Good luck,

01-20-2004, 09:57 AM
Thanks Eric!

Thats what I'm looking for to create and save a query object in access by vb code....

But thanks again for your idea to save only the query parameters in a dummy table.

So now I have to find out how to make a query that uses some fields in that dummy table as parameters.



Eric Frost
01-20-2004, 10:30 AM
The dummy table would be one of the tables in your query and linked to your main table.