Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

ADO Connection Access Database VB

 
   Database Help (Home) -> Visual Basic -> ADO RSS
Next:  A newbie question on array  
Author Message
Bob Leffew

External


Since: Oct 14, 2004
Posts: 3



(Msg. 1) Posted: Tue Feb 22, 2005 1:20 pm
Post subject: ADO Connection Access Database VB
Archived from groups: microsoft>public>vb>database>ado (more info?)

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

 >> Stay informed about: ADO Connection Access Database VB 
Back to top
Login to vote
Paul Clement

External


Since: Sep 02, 2003
Posts: 236



(Msg. 2) Posted: Tue Feb 22, 2005 2:19 pm
Post subject: Re: ADO Connection Access Database VB [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, 22 Feb 2005 12:20:54 -0500, "Bob Leffew" <rleffew.RemoveThis@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.RemoveThis@ameritech.net
Microsoft MVP (Visual Basic)

 >> Stay informed about: ADO Connection Access Database VB 
Back to top
Login to vote
Bob Leffew

External


Since: Oct 14, 2004
Posts: 3



(Msg. 3) Posted: Tue Feb 22, 2005 3:41 pm
Post subject: Re: ADO Connection Access Database VB [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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 
Back to top
Login to vote
Veign2

External


Since: Feb 04, 2004
Posts: 123



(Msg. 4) Posted: Tue Feb 22, 2005 4:09 pm
Post subject: Re: ADO Connection Access Database VB [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Change
cnCejco.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=Y:\Cejco.mdb;" & _
"Jet OLEDB:Database Password=myDbPassword"

To:
cnCejco.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=Y:\Cejco.mdb;" & _
"Jet OLEDB:Database Password=" & myDbPassword

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
<a style='text-decoration: underline;' href="http://www.veign.com/vrc_main.asp" target="_blank">http://www.veign.com/vrc_main.asp</a>
--

"Bob Leffew" <rleffew DeleteThis @harwood-intl.com.nospam> wrote in message
news:e50LrgRGFHA.2992@TK2MSFTNGP09.phx.gbl...
 > 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 
Back to top
Login to vote
Bob Leffew

External


Since: Oct 14, 2004
Posts: 3



(Msg. 5) Posted: Tue Feb 22, 2005 4:17 pm
Post subject: Re: ADO Connection Access Database VB [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks, that did it.

Bob

"Veign" <NOSPAMinveign DeleteThis @veign.com> wrote in message
news:egSpJsRGFHA.3824@TK2MSFTNGP10.phx.gbl...
 > Change
 > cnCejco.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
 > "Data Source=Y:\Cejco.mdb;" & _
 > "Jet OLEDB:Database Password=myDbPassword"
 >
 > To:
 > cnCejco.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
 > "Data Source=Y:\Cejco.mdb;" & _
 > "Jet OLEDB:Database Password=" & myDbPassword
 >
 > --
 > Chris Hanscom - Microsoft MVP (VB)
 > Veign's Resource Center
<font color=purple> > <a style='text-decoration: underline;' href="http://www.veign.com/vrc_main.asp</font" target="_blank">http://www.veign.com/vrc_main.asp</font</a>>
 > --
 >
 > "Bob Leffew" <rleffew DeleteThis @harwood-intl.com.nospam> wrote in message
 > news:e50LrgRGFHA.2992@TK2MSFTNGP09.phx.gbl...
  > > 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 
Back to top
Login to vote
Display posts from previous:   
   Database Help (Home) -> Visual Basic -> ADO All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]