PC Review


Reply
Thread Tools Rate Thread

Connecting to ADO database

 
 
Sebastian
Guest
Posts: n/a
 
      14th May 2004
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

 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      16th May 2004
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


 
Reply With Quote
 
Tarren
Guest
Posts: n/a
 
      17th May 2004
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" <(E-Mail Removed)> wrote in message
news:d67501c439ef$9a326f20$(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Sebastian
Guest
Posts: n/a
 
      17th May 2004
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 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
>
>
>.
>

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      17th May 2004
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


 
Reply With Quote
 
Tarren
Guest
Posts: n/a
 
      17th May 2004
www.connectionstrings.com rocks - thanks, Cor!

"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:%23Q%(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
connecting to remote database without using database links simisantu Webmaster / Programming 0 26th Jul 2007 12:22 AM
connecting to the database =?Utf-8?B?UkJyYWNpbmc=?= Microsoft Access External Data 3 11th May 2005 10:19 PM
Connecting to a database =?Utf-8?B?TXIgQ291cGVy?= Microsoft Outlook Discussion 2 9th Aug 2004 12:43 PM
About connecting to database. Shintaro Microsoft ADO .NET 2 21st Feb 2004 09:27 PM
Connecting in a database Sukist Microsoft Dot NET 2 29th Oct 2003 12:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:10 PM.