IN Clause Question

J

jutlaux

I have a query that is linked to a table (tblDOTID) in another Database
(Lookup.mdb) that is set up with the IN clause as shown in the SQL code
below. Both of these database are access 2003 versions.

SELECT DISTINCT tblDOTID.strDOTID, tblDOTID.strSKU, tblDOTID.strCustomer,
tblDOTID.strSkidGroup, tblDOTID.strBrand_Desc, tblDOTID.strBrand_Code,
tblDOTID.strSize_Code, tblDOTID.dteAuth_Date
FROM tblDOTID IN 'N:\BlueClient\Lookup.mdb';

The problem I have is that the path to the Lookup.mdb database is constantly
changing. How can I make this path a dynamic variable say in a table or some
other way?
 
A

Allen Browne

You will have to modify the query if the path changes, e.g.:

Const strcSql = "SELECT ... FROM FROM tblDOTID IN "
strcSql = strFile = "'N:\BlueClient\Lookup.mdb"
CurrentDb.QueryDefs("Query1").SQL = strcSql & strFile
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Order By clause 4
where clause 2
HAVING clause 2
Using a Password With an SQL IN Clause 1
WHERE CLAUSE 2
IN clause error 1
Passing DB path as IN SQL clause 2
not in criteria fails 2

Top