VB6 Databound controls

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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?
 
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.
 

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.
 
Joined
Oct 12, 2003
Messages
3,015
Are you using DAO or ADO? If ADO then the password is part of the connection string.
 
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.
 

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.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Members online

Top