Link to home
Start Free TrialLog in
Avatar of eylkrn
eylkrn

asked on

change access 2003 password using ADO and visual basic

Hello,

I need to change number of databases and set it the same password.
However , I dont know how to set password using ADO, i'm using access 2003
here is my code and it doesnt work:

            Dim myDbase As ADODB.Connection
            Set myDbase = New ADODB.Connection
            myDbase.Mode = adModeShareExclusive
            myDbase.IsolationLevel = adXactIsolated

        myDbase.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" _
                  & dbpath & " ; DefaultDir=" & App.Path & ";" & "PWD=" & Oldpass & ";"
        myDbase.Execute "Alter database password " & Oldpass & " " & newdbpass

            myDbase.Close

how can I set a new password for the access 2003 database?


Thanks,
Eyal
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

I doubt that you can change the password for an Access database via ADO, as the password IS NOT stored in the MDB, but rather is held in the associated MDW (workgroup file), and as such is not accessible from SQL (or via ADO).

AW
Avatar of eylkrn
eylkrn

ASKER

is there any other way that I change the password?
or is there any program that does what I need?
There most be a way to write a script that change number of databases
SOLUTION
Avatar of Hammadian2
Hammadian2

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I like the link posted by Hammadian2, seems better than my attempt - LOL

Alan
Thanks Alan :)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of eylkrn

ASKER

hi Venabili,

dont close it yet..

Eyal
eylkrn,

Then please reply to the experts that are trying to help you. We are not mind readers so unless you explain what is wrong with the posted comments, we cannot help more..

Venabili
Avatar of eylkrn

ASKER

ok, I'm closing this issue because i'm currently working on another project