Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to bypass linked table password prompt 1

Status
Not open for further replies.

yulce

Programmer
Sep 3, 2003
3
SI
I have a linked table in my access database, which is password protected.

I have a problem how to bypass the password prompt;
i would like that access automatically puts in the correct informaion (UID, PWD, Server) - and doesnt bother other users to fill out the fields.

Thnx, Yulce
 
Where is the linked file from?

When I link a file from ODBC I get asked the question "Do You Want To Save The Password" if I click yes, it saves the password!

hth


Ben

----------------------------------------------
Ben O'Hara

"Where are all the stupid people from...
...And how'd they get so dumb?"
NoFX-The Decline
----------------------------------------------
 
i have it from ODBC too, but it uses Oracle driver. It didnt asked me if i want to save password...

any suggestions?
 
Actually, thinking about it I was using passthru queries rather than linking tables. They are often useful as the query runs on the server & all that is returned are the records you need to see.

You will probably need to link the tables using code if you want to specify the username.

I will have a go & report back.

Ben



----------------------------------------------
Ben O'Hara

"Where are all the stupid people from...
...And how'd they get so dumb?"
NoFX-The Decline
----------------------------------------------
 
When I link the table thru ODBC using a DSN with the Microsoft ODBC for Oracle driver. When selecting the tables there was a check box for save password.

I did find a way of linking Access to Oracle without needing a DSN setting up. Amend this to suit:

Dim td As DAO.TableDef
Set td = CurrentDb.CreateTableDef
td.Name = "Test"
td.Connect = "ODBC;DRIVER={Microsoft ODBC for Oracle};UID=username;PWD=password;SERVER=server;"
td.SourceTableName = "OracleTable"
CurrentDb.TableDefs.Append td

this adds a new table to your access database that is linked to OracleTable in the Oracle database and does not need a dsn on the local machine.

hth

Ben

----------------------------------------------
Ben O'Hara

"Where are all the stupid people from...
...And how'd they get so dumb?"
NoFX-The Decline
----------------------------------------------
 
Don't know if anybody is watching this thread anymore, but I had a quick question. I am in the same position, trying to link a table programatically without the user having to enter a password. I used the code above and it worked great. The only problem is that next time I run the code, the linked table is already created so it gives an error. Then the only way of getting in the table is by entering a password.

While I know this is extremely ineffecient, I was wondering how to delete the linked table programatically so next time I run the code I can recreate it using the above code thereby never having to ask my users to enter a password.

Many thanks.
 
To delete a table, even a linked one you can use
Code:
DoCmd.DeleteObject acTable, "tblWhatever"
You may want to take a look at which loops through all your linked tables checking the link exists and relinking if not.

hth

Ben

----------------------------------------------
Ben O'Hara "Where are all the stupid people from...
...And how'd they get so dumb?"
rockband.gif
NoFX-The Decline
----------------------------------------------
Want to get great answers to your Tek-Tips questions? Have a look at F
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top