how to see a database name in a pivot table?

  • Thread starter Thread starter Johan
  • Start date Start date
J

Johan

When opening ACCESS DB from Excel I have the problem that I can't see on
which DB its linked? Also I can't change de DB from Excel.

Regards, Hiltjo.
 
You can't change the DB. You can get the SQL commands and copy them to a new
liked DB. To get the SQL statements and the connection you can use this macro

Sub GetConnection()

RowCount = 1
For Each MyQuery In ActiveSheet.QueryTables
'Set MyQuery = ActiveSheet.QueryTables.Item(1)
Sheets("Sheet2").Range("A" & RowCount) = MyQuery.Connection
Sheets("Sheet2").Range("A" & RowCount) = MyQuery.Sql
Next MyQuery
End Sub
 

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

Back
Top