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

Update Remote Password Protected DB

Status
Not open for further replies.

SHardy

Programmer
May 9, 2001
231
GB
We have a particular Access database that is used across several sites. Rather than link them all, they are seperate databases that are updated to each other over night. All databases are password protected (using the "set database password").

Due to internal company politics, I cannot get access to one of the sites. They see themselves as seperate company, and do not allow us access to there server. The best we get from them is that they copy the database to us each morning.

However, I am expected to support and maintain ALL these databases, including the one that I cannot connect to.

I have previously had no problems of data content needed updating. I have been able to create little update files in access that I can send to one of the users on this site. These simply, upon opening, link to the required tables. Password is coded into the app. It then performs the necessary updates and closes down.

The real problem that I have is being able to modify/ replace objects, not the data held. I have several updated & new forms, reports & tables that need to replace the existing ones.

How can I do this successfully. It would also be useful if the database password is coded, rather than require the user to enter it each time an action is carried out.

Hope I haven't waffled too much, and that the problem is clear.

Any help greatly appreciated.
 
Not a lot of interest in this one!
Got an answer now if anyone is interested.

Public Function OpenDBPassword()

Dim db As Database
Dim oAcc As Access.Application

TMP = "c:\destinationdatabase.mdb"
ThisDB = Application.CurrentDb.Name
On Error GoTo ErrHandler
Set oAcc = New Access.Application
Set db = oAcc.DBEngine.OpenDatabase(TMP, False, False, ";PWD=password")
oAcc.OpenCurrentDatabase TMP

'This is where the functional code is added.
'Could be using TransferDatabase, DeleteObject, etc.

ExitErrHandler:
db.Close
Set db = Nothing
oAcc.CloseCurrentDatabase
Set oAcc = Nothing
Exit Function

ErrHandler:
With Err
MsgBox .Number & vbCrLf & .Description & vbCrLf & .Source
End With
Resume ExitErrHandler

End Function

Any comments/ better solutions still appreciated, but this is doing the job fine.
 
That's exactly how it's done. Probelm is, I believe, that no-one really understood the question or problem. Also, I dpn't think you need the New Application objectm try it without it...
 
Surely it does need the new aplication. It keeps both databases open in seperate sessions of access, passes control to the one to be updated so that it can "import" (thus eliminating the need to supply the password), passes control back and closes the second session.

Surely you cannot work with two databases within one session of Access?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top