January 29, 2013 at 8:53 am
I have an oracle linked table in an access 2007 database that is linked via an odbc connection.
I have not used access much and am unsure of the structure and syntax of a select statement to a linked table. Could someone please provide and example of one.
Thanks
January 29, 2013 at 9:08 am
Access has linked servers?
i think i just read your question wrong.
If you've correctly set up an Oracle Linked server, you can first use sp_tables_ex MyOracle and you should see a list of some tables.
You posted in a SQL server web site, and talked about Linked servers, which are in SQL server as well....
after that, it's going to require specifics concerning the data there, but it would look something like this:
--list all the tables and their names
EXEC sp_tables_ex MyOracle
GO
select * from MyOracle..SCOTT.EMP
select * from MyOracle..USERNAME.TABLENAME
select * from MyOracle..MFHDS.GMACT
From SQl Server,
Access linked servers look almost exactly the same, but with no user
EXEC sp_tables_ex MyAccess
select * from MyAccess...Invoices;
however, I have not gotten a 64 bit Access Linked server to work yet; as far as i know the ACE driver is broken as far as Access, but works for Excel.
Lowell
January 29, 2013 at 9:22 am
Maybe I was't all that clear.
Let me expand on the problem.
I have an oracle linked table in an access 2007 database.
I created the linked table with an odbc.
when I run the following statement I get an error saying "sytax error near from"
select column1, column2
from linked table.
I was wondering if I need to us an openquery or openrowset in the statement.
Thanks for the help on this.
February 7, 2013 at 8:45 pm
MS Access does not have OPENQUERY or OPENROWSET. Those are SQL Server keywords.
This is a SQL Server/Oracle forum. You need to clarify whether you are talking about MS Access or SQL Server.
What happens when you double click your linked table in MS Access - does it show data?
What happens when you create a query in MS Access - does it work and show data?
February 8, 2013 at 8:18 am
lewis.ray (1/29/2013)
I have an oracle linked table in an access 2007 database.I created the linked table with an odbc.
when I run the following statement I get an error saying "sytax error near from"
select column1, column2
from linked table.
I really doubt that's the actual select statement you are running. Please copy/paste both the statement and the full error message.
_____________________________________
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply