Connecting Tech Pros Worldwide Help | Site Map

Password-protect a BackEnd.DB/ma access 2000

Geir Baardsen
Guest
 
Posts: n/a
#1: Nov 13 '05
Hi!

I wonder if anybody can help with the following:

I need to password-protect tables in MyBackEnd.DB, which is placed in
the same folder as the MyFrontEnd.DB

Now I've tried the KB_209953 article in the microsoft knowledge-base,
and I also looked
up the module example in the developer 2000 edition.

They both produces the error: "Invalid password".

I've checked that Capslock is not on, I've checked the path to the
MyBackEnd.DB,
and I've checked....

So, anybody that really got a working thing on:

1. Check the link to the MyBackEnd.DB
(in the OnOpen-event of 'frmMain' of MyFrontEnd.DB)
and maybe refresh the link (without user interaction)?

2. Open the password-protected MyBackEnd.DB
(in the OnOpent-event of frmMain of MyFrontEnd.DB) ?

Me.Name
Sigurd
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Password-protect a BackEnd.DB/ma access 2000




"Geir Baardsen" <geir_baardsen@hotmail.com> skrev i melding
news:35f9d8b7.0503280512.404fa803@posting.google.c om...[color=blue]
> Hi!
>
> I wonder if anybody can help with the following:
>
> I need to password-protect tables in MyBackEnd.DB, which is placed in
> the same folder as the MyFrontEnd.DB
>
> Now I've tried the KB_209953 article in the microsoft knowledge-base,
> and I also looked
> up the module example in the developer 2000 edition.
>
> They both produces the error: "Invalid password".
>
> I've checked that Capslock is not on, I've checked the path to the
> MyBackEnd.DB,
> and I've checked....
>
> So, anybody that really got a working thing on:
>
> 1. Check the link to the MyBackEnd.DB
> (in the OnOpen-event of 'frmMain' of MyFrontEnd.DB)
> and maybe refresh the link (without user interaction)?
>
> 2. Open the password-protected MyBackEnd.DB
> (in the OnOpent-event of frmMain of MyFrontEnd.DB) ?
>
> Me.Name[/color]

Can this code give you some idea?

Private Function RefreshLinks(strFileName As String) As Boolean
' Refresh links to the supplied database. Return True if successful.

Dim dbsOrders As DAO.Database
Dim tdf As DAO.TableDef
Dim intCount As Integer
Dim strPassword As String
strPassword = "12345678901234567890"
On Error GoTo Errorhandler

' Loop through all tables in the database.
Set dbsOrders = CurrentDb
For intCount = 0 To dbsOrders.TableDefs.Count - 1
Set tdf = dbsOrders.TableDefs(intCount)

' If the table has a connect string, it's a linked table.
If Len(tdf.Connect) > 0 Then
tdf.Connect = ";DATABASE=" & strFileName & ";PWD=" & strPassword
Err.Number = 0

On Error Resume Next
tdf.RefreshLink ' Relink the table.

If Err.Number <> 0 Then
RefreshLinks = False
Exit Function
End If
End If
Next intCount

RefreshLinks = True ' Relinking complete.
Exit Function

Errorhandler:
MsgBox "Error#: " & Err.Number & vbCrLf & Err.Description
RefreshLinks = False
End Function

--
____________________________

Sigurd Bruteig
www.made4u.no


Geir Baardsen
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Password-protect a BackEnd.DB/ma access 2000


>Can this code give you some idea?[color=blue]
>[/color]
Yes, indeed, Sigurd.

Thanks for guiding me.

Me.Name
Geir Baardsen
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Password-protect a BackEnd.DB/ma access 2000


Sorry, Sigurd...

I still get the message: "Invalid password"

I have...

1. Opened the BackEnd in Exclusive mode and set the password. I made
sure Capslock is not on. The backEnd is in the same folder as the
FrontEnd.

2. I've tried your solution and the microsoft knowledgebase solution,
both with the full length of folder path and also just ("MyDB.mdb"). I
made sure I try to open the correct table in order to have the
function work.

3. Nothing works...and I wonder why

Any suggestions?

I thought this would be straight forward.

I use win 98 and Office 2000 dev.ed.

There's an example in the ch.18 of the Dev.ed., but this doesn't
either.

I use and work, up till now, only with DAO.[color=blue]
>
> Me.Name[/color]
Sigurd
Guest
 
Posts: n/a
#5: Nov 13 '05

re: Password-protect a BackEnd.DB/ma access 2000




news:35f9d8b7.0503300013.3c17e554@posting.google.c om...[color=blue]
> Sorry, Sigurd...
>
> I still get the message: "Invalid password"
>
> I have...
>
> 1. Opened the BackEnd in Exclusive mode and set the password. I made
> sure Capslock is not on. The backEnd is in the same folder as the
> FrontEnd.
>
> 2. I've tried your solution and the microsoft knowledgebase solution,
> both with the full length of folder path and also just ("MyDB.mdb"). I
> made sure I try to open the correct table in order to have the
> function work.
>
> 3. Nothing works...and I wonder why
>
> Any suggestions?
>
> I thought this would be straight forward.
>
> I use win 98 and Office 2000 dev.ed.
>
> There's an example in the ch.18 of the Dev.ed., but this doesn't
> either.
>
> I use and work, up till now, only with DAO.[color=green]
>>
>> Me.Name[/color][/color]
Hei igjen!

Svarer på norsk, litt lettere.

Tuklet selv en del med syntaksen på passordkoden, men denne koden fungerer
feilfritt hos meg. Bruker selv Windows XP og Office XP. Har selv hatt
problemer med noe kode hvis jeg har referanse til både DAO og ADO. Sett DAO
før ADO i listen over bibliotekreferanser. Hvis du vil kan du jo sende meg
databasen din, så kan jeg se hvordan det funker hos meg, fjern event.
sensitive data først.

--
____________________________


Sigurd Bruteig
www.made4u.no


Geir Baardsen
Guest
 
Posts: n/a
#6: Nov 13 '05

re: Password-protect a BackEnd.DB/ma access 2000


Ok, æ ska fårsøk ijæn!

Me.Name
Closed Thread