469,575 Members | 1,680 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,575 developers. It's quick & easy.

Connecting to ADO database

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
5 1945
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
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
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
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
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.

Similar topics

4 posts views Thread by CodeImp | last post: by
5 posts views Thread by Odd Bjørn Andersen | last post: by
reply views Thread by =?Utf-8?B?R2lkaQ==?= | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.