1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

VB6 Databound controls

Discussion in 'Software Development' started by Royv, Oct 16, 2003.

Thread Status:
Not open for further replies.
Advertisement
  1. Royv

    Royv Thread Starter

    Joined:
    Jul 5, 2003
    Messages:
    7
    I'm trying to use databound controls to develop a query/update system for a database which has a password. How do I supply the password?
     
  2. coderitr

    coderitr

    Joined:
    Oct 12, 2003
    Messages:
    3,015
    The password is part of the connection string to the database. If you don't want to hard-code it into your program then you'll have to prompt the user for database authentication credentials then set the connection string property of your database connection object dynamically.
     
  3. Royv

    Royv Thread Starter

    Joined:
    Jul 5, 2003
    Messages:
    7
    I'm sorry I haven't explained properly. I've coded database applications in other programs using connection strings & supplying my own code to handle everything. Here, I'm trying to use a data control & there's nowhere in the properties box to add a password. I supply the database name but, when I try to type in the record source, it gives me a 'Not a valid password' error. I've tried adding the password to the database name in various ways but all get rejected.
    I'm not very well up on the use of databound controls & would appreciate some further help.
     
  4. coderitr

    coderitr

    Joined:
    Oct 12, 2003
    Messages:
    3,015
    Are you using DAO or ADO? If ADO then the password is part of the connection string.
     
  5. Royv

    Royv Thread Starter

    Joined:
    Jul 5, 2003
    Messages:
    7
    I'm using DAO.
     
  6. coderitr

    coderitr

    Joined:
    Oct 12, 2003
    Messages:
    3,015
    The only way that I can find to do what you want is the access the database through ODBC. Then you can specify the entire ODBC connection string, including the password, in the connect property of VB's intrinsic data control and leave the DatabaseName property blank.

    I recommend, however, using ADO. MS is phasing out support for DAO and moving forward, ADO will allow you to use an alternate database solution without changing your code. With ADO, once the initial connection is made to the database, the access code is written the same way regardless of what the underlying database engine happens to be. In short, with ADO, the developer doesn't need to care what type of database the target is.
     
  7. Royv

    Royv Thread Starter

    Joined:
    Jul 5, 2003
    Messages:
    7
    Thanks for your help. I'll start looking into ADO & convert to that before continuing with this project.
     
  8. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/172288

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice