By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,496 Members | 1,527 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,496 IT Pros & Developers. It's quick & easy.

Connecting to ADO database

P: n/a
I'm using the following code to connect to an access 2000
database.
(with reference to adodb)
Public DBvar As New ADODB.Connection()
DBvar.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=Data.mdb", "userID", "Pass")
Previously I was connecting with just
DBvar.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=Data.mdb")
and it was working fine because I had not set a password
for the database. Then I set a password and now using:
DBvar.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=Data.mdb", "Admin", "Pass")
and I get this error:
"Cannot start your application. The workgroup information
file is missing or opened exclusively by another user."
When I set the password I had to open the database file
exclusively for it to set it. Does that have anything to
do with it?
What does this error mean? How do I fix this?

Thank you

Seb

Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi Sebastian,

I think that the best thing to do for specific Classic problems is to ask it
in a VB classic newsgroup.

microsoft.public.vb

I think you have more change to find information there because in VB.net is
mostly used Ado.net.

Cor
Nov 20 '05 #2

P: n/a
For one thing it looks as though your connection string is structured
incorrectly. Make a text file on the desktop, rename it to something.udl
and create your connection string in the GUI. Then open the udl in notepad
and cut and pasted your connection string.

Is this VB6? If it is .NET you should be using oledb namespace for
connecting to Access mdb. Regardless of whether it is VB6 or .NET, take a
look at your connection string.
"Sebastian" <Se*******@ilogic.com> wrote in message
news:d6****************************@phx.gbl...
I'm using the following code to connect to an access 2000
database.
(with reference to adodb)
Public DBvar As New ADODB.Connection()
DBvar.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=Data.mdb", "userID", "Pass")
Previously I was connecting with just
DBvar.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=Data.mdb")
and it was working fine because I had not set a password
for the database. Then I set a password and now using:
DBvar.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=Data.mdb", "Admin", "Pass")
and I get this error:
"Cannot start your application. The workgroup information
file is missing or opened exclusively by another user."
When I set the password I had to open the database file
exclusively for it to set it. Does that have anything to
do with it?
What does this error mean? How do I fix this?

Thank you

Seb

Nov 20 '05 #3

P: n/a
How do I need to change the code to connect using ado .net
with username and password?
Do I remove the reference to adodb? Do I add any other
references?

Thanks

Sebastian
-----Original Message-----
Hi Sebastian,

I think that the best thing to do for specific Classic problems is to ask itin a VB classic newsgroup.

microsoft.public.vb

I think you have more change to find information there because in VB.net ismostly used Ado.net.

Cor
.

Nov 20 '05 #4

P: n/a
Hi Sebastian,

When you use AdoNet you cannot use the recordset, however filling a dataset
can be as simple as this

dim conn as new OleDb.OleDbconnection(www.connectionstrings.com)
dim ds as new dataset
dim da as new OleDB.OleDbDataAdapter("Select * From Mytable",conn)
da.fill(ds)

And your dataset is filled.

I hope this give you an idea?

Cor
Nov 20 '05 #5

P: n/a
www.connectionstrings.com rocks - thanks, Cor!

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:%2*****************@TK2MSFTNGP11.phx.gbl...
Hi Sebastian,

When you use AdoNet you cannot use the recordset, however filling a dataset can be as simple as this

dim conn as new OleDb.OleDbconnection(www.connectionstrings.com)
dim ds as new dataset
dim da as new OleDB.OleDbDataAdapter("Select * From Mytable",conn)
da.fill(ds)

And your dataset is filled.

I hope this give you an idea?

Cor

Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.