Question Create a View of a Table from One Databate in Another

Margarita

Registered User.
Local time
Today, 15:54
Joined
Aug 12, 2011
Messages
185
Hello, I would appreciate any general advice on how to handle this problem:
There are two databases, both access 2003. I need an Invoices table to be linked from database A to database B. I am the creator of database B, but I do not have read or write permissions for database A. The only thing I could theoretically get a permission to view are the entires from A's Invoices table that are relevant to me (they are flagged appropriately). The only way I could get this permission is if I can help the people maintaining database A set up this view in a way that wouldn't impact their workflow at all- that is, they don't want to have to update a any temporary tables, run any macros, etc.
So I found this post on creating a view in vba that appears in the Queries tab of the database window:

PHP:
Sub CreateViewAdo()
'http://www.pcreview.co.uk/forums/do-use-create-view-access-2003-a-t1685655.html
Dim cn As ADODB.Connection
Dim strSql As String
strSql = "CREATE VIEW TestView AS SELECT MyTable.* FROM MyTable;"
Set cn = CurrentProject.Connection
cn.Execute strSql
Debug.Print "MyTableView created"
Set cn = Nothing
End Sub

I tried it and it works on a table in my database B. Would anyone be able to tell me how to modify this to have it work if MyTable resides in database A, to which I have no read permission in general? Is this even possible?
Thank you in advance!
 

Users who are viewing this thread

Back
Top Bottom