I changed everything to this and still get the message "Invalid Password".
I changed everything to the following:
dim myDbPassword as string
myDbPassword = "cEj2235"
Set cnCejco = New ADODB.Connection
If cnCejco.State = adStateOpen Then Exit Function
Set cnCejcoFTP = New ADODB.Connection
If cnCejcoFTP.State = adStateOpen Then Exit Function
If Dir("Y:\Cejco.mdb") <> "" Then
cnCejco.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=Y:\Cejco.mdb;" & _
"Jet OLEDB:Database Password=myDbPassword"
End if
"Paul Clement" <UseAdddressAtEndofMessage DeleteThis @swspectrum.com> wrote in message
news:j81n1153mttkoumgkobm1rp6o2ak7prbqd@4ax.com...
> On Tue, 22 Feb 2005 12:20:54 -0500, "Bob Leffew"
<rleffew DeleteThis @harwood-intl.com.nospam> wrote:
>
> ¤ I have been accessing a database on a local drive thru an ADO
connection.
> ¤
> ¤ The following is the code that I have been using.
> ¤
> ¤ cnCejco.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
> ¤ Source=Y:\Cejco.mdb;Persist Security Info=False"
> ¤
> ¤ The problem is now I have added a password to the Database.
> ¤
> ¤ I keep getting the message "Password not Valid" When using the above
code.
> ¤
> ¤ I looked up how to add a password to the above and changed to the
following.
> ¤
> ¤ myUserName = "Admin"
> ¤ myPassword = "cEj2235"
> ¤ myDbPassword = "cEj2235"
> ¤
> ¤ Set cnCejco = New ADODB.Connection
> ¤ If cnCejco.State = adStateOpen Then Exit Function
> ¤ Set cnCejcoFTP = New ADODB.Connection
> ¤ If cnCejcoFTP.State = adStateOpen Then Exit Function
> ¤ cnCejco.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> ¤ "Data Source=Y:\Cejco.mdb;" & _
> ¤ "Jet OLEDB:Database Password=MyDbPassword", _
> ¤ "myUsername", "myPassword"
> ¤ I was not sure how to do this so I went ahead and create a Dim for
> ¤ myUserName, myPassword and mydbPassword as strings and set them to a
> ¤ constant.Now I get the message "Cannot start your application. The
> ¤ Workgroup information file is missing or opened exclusively by another
> ¤ user."I checked to make sure the database was not being used by
anything.
> ¤ It seemed not to be.Thanks in advance.Bob Leffew
> ¤
>
> If you're just using a database password then remove the user name and
password parameters.
>
> cnCejco.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> "Data Source=Y:\Cejco.mdb;" & _
> "Jet OLEDB:Database Password=MyDbPassword"
>
>
> Paul ~~~ pclement DeleteThis @ameritech.net
> Microsoft MVP (Visual Basic)<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: ADO Connection Access Database VB