PC Review


Reply
Thread Tools Rate Thread

Checking the database has a password???

 
 
Jon S via DotNetMonster.com
Guest
Posts: n/a
 
      31st Oct 2005
Hi all,

I'm producing a database connection string but I need a way to establish if
the database has a password or not. There are two versions of the database
I'm opening, the first doesn't have a password and the second does. So if
the database has a password then open it with a string that includes a
password, else open it with a string that doesn't include a password. How
can I find out if the database has a password before I try and open it???
I'm using ado.net and C#.

Thanks in advance,
Jon.


--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...o-net/200510/1
 
Reply With Quote
 
 
 
 
W.G. Ryan - MVP
Guest
Posts: n/a
 
      31st Oct 2005
It will depend on the database you're using, but essentially I think you're
going to have to try xxxConnection.Open in a try catch block and if you get
an exception, check if it's a password problem, then use the next connection
string and repeat
"Jon S via DotNetMonster.com" <u2272@uwe> wrote in message
news:56a7fa1141f8e@uwe...
> Hi all,
>
> I'm producing a database connection string but I need a way to establish
> if
> the database has a password or not. There are two versions of the
> database
> I'm opening, the first doesn't have a password and the second does. So if
> the database has a password then open it with a string that includes a
> password, else open it with a string that doesn't include a password. How
> can I find out if the database has a password before I try and open it???
> I'm using ado.net and C#.
>
> Thanks in advance,
> Jon.
>
>
> --
> Message posted via DotNetMonster.com
> http://www.dotnetmonster.com/Uwe/For...o-net/200510/1



 
Reply With Quote
 
Jon S via DotNetMonster.com
Guest
Posts: n/a
 
      31st Oct 2005
Hi Mr Ryan,

I'm using an Access 2000 database. I thought that may have to be the way
around it. I was just wondering if ADO.NET had its own way of testing for a
password before creating the connection string.

Many thanks.


--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...o-net/200510/1
 
Reply With Quote
 
W.G. Ryan - MVP
Guest
Posts: n/a
 
      31st Oct 2005
Jon - i'm not an Access guy, but I there's not anything in the ADO.NET
library that I've ever heard of that can tell you if the db has a password
on it without attempting to open it. However, there may be a way via access
that I don't know about.
"Jon S via DotNetMonster.com" <u2272@uwe> wrote in message
news:56a9dfdcbeda6@uwe...
> Hi Mr Ryan,
>
> I'm using an Access 2000 database. I thought that may have to be the way
> around it. I was just wondering if ADO.NET had its own way of testing for
> a
> password before creating the connection string.
>
> Many thanks.
>
>
> --
> Message posted via DotNetMonster.com
> http://www.dotnetmonster.com/Uwe/For...o-net/200510/1



 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      1st Nov 2005
On Mon, 31 Oct 2005 13:56:52 -0500, "W.G. Ryan - MVP" <(E-Mail Removed)> wrote:

¤ Jon - i'm not an Access guy, but I there's not anything in the ADO.NET
¤ library that I've ever heard of that can tell you if the db has a password
¤ on it without attempting to open it. However, there may be a way via access
¤ that I don't know about.

Your suggestion about trapping the error is best, especially in light of the fact that Access
supports two different types of database security.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
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
I saved password into the database with "binary" data type from GetByte method. How can I to compare the password that between database and transfered from the page? Benny Ng Microsoft Dot NET Framework 3 25th Jan 2006 06:49 AM
I saved password into the database with "binary" data type from GetByte method. How can I to compare the password that between database and transfered from the page? Benny Ng Microsoft ASP .NET 3 25th Jan 2006 06:49 AM
I saved password into the database with "binary" data type from GetByte method. How can I to compare the password that between database and transfered from the page? Benny Ng Microsoft Dot NET 3 25th Jan 2006 06:49 AM
Checking for a database password =?Utf-8?B?Sm9zaHVhIFNjaGFpcmJhdW0=?= Microsoft Access Form Coding 5 11th Jan 2005 05:53 PM
using Properties("Jet OLEDB:Database Password").value = xxxxxxx opens database with no password db Microsoft Access Security 0 16th Sep 2003 06:02 PM


Features
 

Advertising
 

Newsgroups
 


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