Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      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" 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" wrote in message

 > On Tue, 22 Feb 2005 12:20:54 -0500, "Bob Leffew"
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"
 >
 >

 > Microsoft MVP (Visual Basic)
 >> 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 rel="nofollow" style='text-decoration: none;' href="http://www.veign.com/vrc_main.asp" target="_blank">http://www.veign.com/vrc_main.asp</a>
--

"Bob Leffew" wrote in message

 > 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
 >
 >


  > > On Tue, 22 Feb 2005 12:20:54 -0500, "Bob Leffew"

  > >
  > > ¤ 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"
  > >
  > >

  > > 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. 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" wrote in message

 > 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 rel="nofollow" style='text-decoration: none;' href="http://www.veign.com/vrc_main.asp</font" target="_blank">http://www.veign.com/vrc_main.asp</font</a>>
 > --
 >


  > > 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
  > >
  > >

message

   > > > On Tue, 22 Feb 2005 12:20:54 -0500, "Bob Leffew"

   > > >
   > > > ¤ 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"
   > > >
   > > >

   > > > Microsoft MVP (Visual Basic)
  > >
  > >
 >
 >
 >> Stay informed about: ADO Connection Access Database VB 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
DataEnvironment Connection to a remote SQL Server database - Hi, I am trying to connect one PC (win98) to SQL Server located on another PC (winxp1) but am failing with an error message: Test connection failed because of an error in initializing provider. [DBNETLIB][Connection Open(Connect()).]SQL Server does...

Create Database - Hi, Looking for some ideas ? ADO / RDO ? I need to develope a visual basic application that when a user launches the application it checks to see if the datase for the user is created if the user does not have a DATABASE it creates one then creates a...

Updating An ADO 2.6 Recordset With VB and Access - When I try to update my ADO Recordset like this: recSet.Fields(2).Value = strFileNum I get this: Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype. Error 3251 When I try t...

Accessing a report made from MS Access using VB6. - Dear fellow programmers, With vb6, i am using MS Access as my database. I already made a lot of reports in the MS Access and i want to access that reports too in my vb6 program. My vb6 program should be able to view and print those MS Access ..

How do I run a report in Access from Visual Basic? - I have a report written in Access that is now working pretty well and I would like to include it in the VB application that uses the Access database that the report is in. I have used VB to build the tables the report is based on and I would like to let...
   Database Help (Home) -> Visual Basic -> ADO All times are: Pacific Time (US & Canada)
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 ]