By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,705 Members | 1,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,705 IT Pros & Developers. It's quick & easy.

ODBC problems

P: n/a
I currently link a table to an Oracle db. Anytime I open a query
based off it, I have to input username & password. Is there a way to
do this automatically?

I'd prefer to use linked tables, but I've read a pass-through query
can pass the passwords automatically. The directions seem
straightforward, but I can't get one to work. The select query from
the ODBC linked table looks like:

SELECT OSCAR_TBLSALESMAN.SALESMAN, OSCAR_TBLSALESMAN.NAME,
OSCAR_TBLSALESMAN.INITIALS, OSCAR_TBLSALESMAN.TERRITORY,
OSCAR_TBLSALESMAN.SALESMANTYPE, OSCAR_TBLSALESMAN.SALESFORCE,
OSCAR_TBLSALESMAN.SALESMANRSM, OSCAR_TBLSALESMAN.SALESMANRVP,
OSCAR_TBLSALESMAN.LOCATION, OSCAR_TBLSALESMAN.CUSTOMER,
OSCAR_TBLSALESMAN.TRANSMITTINGLOCATION
FROM OSCAR_TBLSALESMAN;

When I convert it to a pass-through I get the error message:

ODBC call failed.
[Microsoft][ODBC driver for Oracle][Oracle]ORA-00911:invalid character
(#911)

I know the underscore is invalid for Oracle so I replaced it with a
period

SELECT OSCAR.TBLSALESMAN.SALESMAN, OSCAR.TBLSALESMAN.NAME,
OSCAR.TBLSALESMAN.INITIALS, OSCAR.TBLSALESMAN.TERRITORY,
OSCAR.TBLSALESMAN.SALESMANTYPE, OSCAR.TBLSALESMAN.SALESFORCE,
OSCAR.TBLSALESMAN.SALESMANRSM, OSCAR.TBLSALESMAN.SALESMANRVP,
OSCAR.TBLSALESMAN.LOCATION, OSCAR.TBLSALESMAN.CUSTOMER,
OSCAR.TBLSALESMAN.TRANSMITTINGLOCATION
FROM OSCAR.TBLSALESMAN;

I get the same error message, so I tried taking out the Oscar section

SELECT TBLSALESMAN.SALESMAN, TBLSALESMAN.NAME, TBLSALESMAN.INITIALS,
TBLSALESMAN.TERRITORY, TBLSALESMAN.SALESMANTYPE,
TBLSALESMAN.SALESFORCE, TBLSALESMAN.SALESMANRSM,
TBLSALESMAN.SALESMANRVP, TBLSALESMAN.LOCATION, TBLSALESMAN.CUSTOMER,
TBLSALESMAN.TRANSMITTINGLOCATION
FROM OSCAR.TBLSALESMAN;

And

SELECT TBLSALESMAN.SALESMAN, TBLSALESMAN.NAME, TBLSALESMAN.INITIALS,
TBLSALESMAN.TERRITORY, TBLSALESMAN.SALESMANTYPE,
TBLSALESMAN.SALESFORCE, TBLSALESMAN.SALESMANRSM,
TBLSALESMAN.SALESMANRVP, TBLSALESMAN.LOCATION, TBLSALESMAN.CUSTOMER,
TBLSALESMAN.TRANSMITTINGLOCATION
FROM TBLSALESMAN;

Then I tried removing the tablename portion:

SELECT SALESMAN, NAME, INITIALS, TERRITORY, SALESMANTYPE, SALESFORCE,
SALESMANRSM, SALESMANRVP, LOCATION, CUSTOMER, TRANSMITTINGLOCATION
FROM TBLSALESMAN;
Any help?
Thanks
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
For password/ID issues with ODBC connections - if you could relink your
table to the Oracle DSN there is a "save Password" checkbox on the Link
dialog box. Check that for it to remember your password. Note: In
order to create a DSN (or any other type of connection with an Oracle
DB, the Oracl Client needs to be installed - if you can see data with
your current link, then the Oracle client is installed - the
Microsoft/Oracle driver does not come into this picture). The Oracle
link is made to the Oracle service which you configure in the Oracle
Client.

For querying an Oracle table, you need to be up on PL Sql (Oracle sql).
Access uses Jet-Sql, MS Sql Server uses Transact Sql, Oracle uses PL
Sql. They are all fairly similar except for the really little things.
Of course, Transact Sql and PL sql support way more functionality than
Jet sql because these guys support industrial sized DB's where Access is
basically a front end system with tables that server as data buffers and
limited RDBMS functionality (on the industrial level).

Here is a sample PL sql statemet that you can run in Access:

"SELECT COUNT(fld1) FROM oraSvc1.oraTbl1 WHERE Datefld >=
TO_DATE('01-01-04', 'DD-MM-YY')"

Here oraSvc1 is a namespace (name) for a Service to a specific Oracle DB
and oraTbl1 is a table in the Oracle DB. I want to retrieve records
from this table where a date field in the table (Datefld) has values
greater than or equal to #1/1/04#. Note how PL sql delimits dates with
single quotes. Additionally, you have to cast the date value using the
PL Sql TO_DATE function which takes 2 arguments.
Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #2

P: n/a
> For password/ID issues with ODBC connections - if you could relink your
table to the Oracle DSN there is a "save Password" checkbox on the Link
dialog box. Check that for it to remember your password.


That was simple. Thanks Rich. I knew the Oracle SQL was different
and was trying to convert the Access SQL, but I don't need to now.
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.