How to use access 2007 external database paths

C

codeSlave

I have a database that several computers access. I have a query that is a
union something like this:
SELECT main.*,"list1" as owner
FROM C:\path\test1.mdb.main
where main.listname<>"condition"
UNION
Select main.*, "list2" as owner
From C:\paths\test2.accdb.main

Now this works fine from the hosting computer, but from another computer it
doesn't. I am now using the shared drive name\path in a second query and
advising users to use the correct query. this seems like a hack. Is there a
way of making it so I can use just one query so all users trying to execute
the query can without multiple query's?
 
D

Douglas J. Steele

If I'm understanding you correctly, the issue is that C:\paths\test1.accdb
and C:\paths\test2.accdb don't exist on the users computers, but rather on
the host computer. You should be able too use an UNC instead:

SELECT main.*,"list1" as owner
FROM \\servername\C$\path\test1.mdb.main
where main.listname<>"condition"
UNION
Select main.*, "list2" as owner
From \\servername\C$\paths\test2.accdb.main
 
C

codeSlave

Works like a champ, much thanks.

Douglas J. Steele said:
If I'm understanding you correctly, the issue is that C:\paths\test1.accdb
and C:\paths\test2.accdb don't exist on the users computers, but rather on
the host computer. You should be able too use an UNC instead:

SELECT main.*,"list1" as owner
FROM \\servername\C$\path\test1.mdb.main
where main.listname<>"condition"
UNION
Select main.*, "list2" as owner
From \\servername\C$\paths\test2.accdb.main

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)





.
 

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

Top