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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

password for backend database

Status
Not open for further replies.

santeMalatesta

Programmer
Joined
Jun 9, 2006
Messages
3
Location
IT
I've split my msaccess database into a backend and a frontend. Now I've protected the backend through a password, while the frontend is not protected. Obviously I Know the password, but I don't know how to make it usefull! Infact when running the frontend and trying to access the backend, I get an error, because a password is required. Is there a way to set the password through a procedure in the frontend that can make me access the backend, so avoiding the error message?
Thanks a lot.
SanteMalatesta
 
How are ya santeMalatesta . . .

Have you tried relinking using the [blue]Linked table Manager[/blue] (Tools - Database Utilities - Linked table Manager)?

Calvin.gif
See Ya! . . . . . .
 
Code:
Dim ws As Workspace, db As Database, tbl As TableDef
dim myUserName As String, myPassword As String, myDBName As String

Set ws = DBEngine.CreateWorkspace("RemoteDB", myUserName, myPassword)
Set db = ws.OpenDatabase(myDBName)
You can now refer programmatically to db and do with it anything you have permission to do when logged on as myUserName.

HTH.
 
I thank you for the suggestions, but it doesn't work: I get an application error when I enforce the TheAceMan1's solution, and a debug error when I take the Adalger's solution.
 
santeMalatesta,

I'd recommend using Access workgroup security rather than a simple database password. Do a search on the tek-tips FAQ...

Ed Metcalfe.

Please do not feed the trolls.....
 
OK santeMalatesta . . .

Lets do this the foolproof way!

Before you attempt this . . . [purple]backup the Front/Back ends so you can come back to square one if necessary![/purple]
[ol][li]Open the [blue]FrontEnd[/blue].[/li]
[li]Close any [blue]open forms[/blue].[/li]
[li]Goto the [blue]tables window[/blue] & delete all linked tables ([purple]they all have an right pointing arrow[/purple], write the names down for reference).[/li]
[li]Now, from the menubar. . . [blue]File[/blue] - [blue]Get External data[/blue] - [blue]Link Tables[/blue][/li]
[li]Navigate to & select the [blue]BackEnd DB[/blue].[/li]
[li][purple]You'll be asked for a password[/purple] for the BackEnd . . . [purple]enter the password [/purple] to continue ([blue]this is where your problem lies![/blue]).[/li]
[li][blue]Link Tables[/blue] window appears . . . if the password passes![/li]
[li]Select the tables you want to link to (from the list in 3 above) and click OK.[/li][/ol]
That should do it! . . . [blue]all linked tables will appear with a right facing arrow.[/blue]

[purple]Checkout opereations . . . and let me know . . .[/purple]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top