I use a query to update an external database with most recent data, as follows:
Which works perfect.
But I would like to parameterize the database name. Is that possible using a syntax like:
I have tried all sorts of things but found no way to get that to work., Anyone tips : is this possible at all ?
Tx !
Code:
INSERT INTO [;DATABASE=C:\Users\michi\TParchive\Archive.accdb].Archive
SELECT * FROM Archive
WHERE OrderId IN (
SELECT Src.OrderId FROM Archive Src
LEFT JOIN [;DATABASE=C:\Users\michi\TParchive\Archive.accdb].Archive Dest
ON Src.OrderId = Dest.OrderId
WHERE Dest.OrderId IS null
)
Which works perfect.
But I would like to parameterize the database name. Is that possible using a syntax like:
Code:
PARAMETERS [MyDB] char;
INSERT INTO [;MyDB].Archive
SELECT * FROM Archive
WHERE OrderId IN (
SELECT Src.OrderId FROM Archive Src
LEFT JOIN [;MyDB].Archive Dest
ON Src.OrderId = Dest.OrderId
WHERE Dest.OrderId IS null
)
I have tried all sorts of things but found no way to get that to work., Anyone tips : is this possible at all ?
Tx !