Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I posted once before, asking how I

Status
Not open for further replies.

LlomaxX

Programmer
Nov 7, 2002
64
US
I posted once before, asking how I could reset a mainframe password from my VB app. But now, I'm curious. When using ADO, how does one reset a password at all? Anywhere?

Back in the DAO days, you could send in a new password twice and change it. But I can find absolutely nothing in ADO documentation on how to change or reset a password when connecting to a database.

Surely I'm not the first person to come across this. . . Any Ideas? Anyone?
 
Interesting, but doesn't solve the basic problem. I have a VB app. Users need to connect to a database when they open the app. They must enter a user name and password to get a connection. If the user's password has expired, how can you send something through ADO to reset it. The above link assumes you already have a connection, and can send stuff through it to reset the password.

ConnectionString commands don't support a New and Verify, where a new password could be submitted.

Can it be done at all? If not, then how are you supposed to reset a password in a VB app?
 
JRO 'Jet Replication Object' can be used to change the database password. You can use the compact and repair method passing in the current and new passwords. I hope this helps.
 
Just in case someone finds this, looking for the answer I found....I was attempting to connect to a DB2 database on a mainframe through DB2Connect. I wanted my app to allow users to reset their password when it expired instead of forcing users to go out to the mainframe to do it.

I found out that the ODBC driver for IBM DB2 DOES support passing a new password in with the connect string. Use the keyword NEWPWD to pass in the new password.

So, using an ADO Connection object, we have:

adoConn.Open "DSN=[DSNName];UID=[UserID];PWD=[OldPassword];NEWPWD=[NewPassword]";"

Any part of the Connection String that ADO doesn't understand, it just passes it along to the driver, in hopes that the driver knows what it means. In this case, since the IBM DB2 ODBC driver supports password changes, it takes the new password, and resets the user's mainframe password.

Works like a charm!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top