Results 1 to 8 of 8

Thread: password protection

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046

    password protection

    I have a VB prog that reads from and writes to an mdb which is password protected. I've noticed that a non password protected version of my mdb works fine with this app.

    I really would like the prog to stop if the mdb is not password protected. Any ideas on how to do this?

    I assume I'd have to somehow test a prop of the mdb to see if the password is activated.

    Thanks for any help.

  2. #2
    m00dy
    Guest
    try to connect without the password parameters,
    if sucssesfull stop the app
    if an error occures you could test for the error number(im not sure wot it would be) if it signifies password required then call your proper connect function with the password parameters

    hope this helps

  3. #3
    Frenzied Member Mega_Man's Avatar
    Join Date
    Mar 2001
    Location
    North of England, South-East of Iceland
    Posts
    1,067
    I would use 2 connection strings. One with and one without a password.
    Try the one without first and make sure you handle the errors.
    if you get no errors, then the connection is successful so exit the app. Obviously, you don't want to display a message like "This database is not password protected" hehe

    Mega.
    "If at first you don't succeed, then skydiving is not for you"

  4. #4
    Frenzied Member Mega_Man's Avatar
    Join Date
    Mar 2001
    Location
    North of England, South-East of Iceland
    Posts
    1,067
    Oops, Sorry M00dy Same reply
    That's what happens when I open a thread and then go and watch trekky.
    That's what the refresh button is for.
    O well, great minds think alike
    "If at first you don't succeed, then skydiving is not for you"

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046
    excellent idea! Thanks!

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046

    well, almost

    Even if I trap the error, I still get the "Invalid Password" message box, so this won't work.

    Any other ideas?

    Thanks again.

  7. #7
    Frenzied Member Mega_Man's Avatar
    Join Date
    Mar 2001
    Location
    North of England, South-East of Iceland
    Posts
    1,067
    What are you doing to trap the error?If you want, attach your code and I will sort it for you.
    Last edited by Mega_Man; Jan 17th, 2002 at 06:59 AM.
    "If at first you don't succeed, then skydiving is not for you"

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046
    I was trying to set the datasource property of an adodc to the unprotected database. I got rid of that and it works fine now. Guess I got a little cut and paste crazy.

    Anyway, thanks for getting me on track with this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width