Advertisement

03.27.2008 at 03:57PM PDT, ID: 23275960
[x]
Attachment Details

MS Access: Oracle ODBC driver does not store password or refreshlink not working

Asked by lapchern in Microsoft Access Database

Tags: Access 2003

I'm helping a friend trying to debug this issue as he's posted all over the web, so I've come to the experts for some help... here's the question below:

I have a problem converting linked tables in MS Access from Sybase to Oracle. The problem
is that with the Oracle driver the password prompt appears every single time the table
is opened (undesirable). When Sybase was used, the password prompt only was shown the first
time a table was opened (which was good).

Configuration:
- MS Access 2003
- Windows XP
- Linked tables are created without checking the "Save Password" box in each instance
- Oracle ODBC driver 10.2.0.3
- Using a File DSN

Details:

I am in a conversion of the application to move it from linking from Sybase
to instead link from Oracle.

Starting point:
I have a .mdb file that has linked tables. The tables originally were
linked to a Sybase database using Sybase's ODBC driver. When I open a table
in data view, it prompts me for the username and password. After supplying
the information, I am shown the data. Any subsequent openings of the tables
to that same Sybase database are not prompted for the username and password.
This is how I want it.

New point:
When I now have removed the tables and linked them again to an Oracle
database using Oracle's ODBC driver, the password prompt comes up EVERY time
the table is opened--even if I have previously supplied it. Furthermore, I
am prompted for the password two times (the prompt window comes up once, I
add the password, and then it appears again and I add the password
again--then the data view is displayed). This is NOT how I want it.

I cannot solve this by checking the "Save Password" box while initially linking the tables (won't work with my requirements).

What is going on here? Why is Oracle's 10.2.0.3 ODBC driver not storing the
password like the Sybase driver did?

followup:
By creating a new Access database file I determined that I could successfully link a table with the Oracle driver. Therefore, I then stepped through the custom code of the application to see if anything in there was causing the problem. I have narrowed the problem down to the following:

1. Manually re-creating the linked tables works correctly.
2. It is only when custom code refreshes the links the password prompt problem occurs.

Details:
With the Oracle ODBC drivers (Microsoft's, Oracle 9, and Oracle 10), the RefreshLink method of the TableDef object in VBA causes something to go wrong with the linked tables. Problems such as multiple password prompts or Access crashing have occurred.

Here is the chunk of code that runs in the Access application. Once the RefreshLink line of code (the last line) executes, the table is no longer usable (because multiple password prompts need to be handled for the table from that point on):



If anyone has any idea why the RefreshLink method would cause this behavior, please post.


Thank you in advance for any input.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
Dim db As DAO.database
Dim tdf As DAO.TableDef
 
Set db = CurrentDb()
Set tdf = db.TableDefs("TableName")
tdf.Connect = "ODBC;FILEDSN=" & strFileDsnName & ";UID=" & strUserName & ";PWD=" & strPassword
tdf.RefreshLink
[+][-]03.27.2008 at 04:06PM PDT, ID: 21226629

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.27.2008 at 04:12PM PDT, ID: 21226673

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.27.2008 at 04:17PM PDT, ID: 21226706

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.27.2008 at 04:18PM PDT, ID: 21226712

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.27.2008 at 04:23PM PDT, ID: 21226735

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.28.2008 at 04:48PM PDT, ID: 21234831

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Access Database
Tags: Access 2003
Sign Up Now!
Solution Provided By: lapchern
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628