January 29th, 2002, 12:05 pm
This should be possible by writing your own Excel function, with VBA code behind that builds the query and makes the ODBC calls according to the parameters supplied.
Beware, the query building could be a little tricky. You might need to know some VB text processing (concatenating variable and fixed strings for example) in order to create the SQL for the query. If you don't know SQL (the database standard query language), use the Access query builder and then choose to view the query SQL. Then go back to VB to come up with a means of constructing this in your spreadsheet function.
I don't have any examples to hand, but there must be someone out there with a little time on their hands who can help...