Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Connect in Powerbuilder to sql server after password expired

Posted on 2009-02-08
8
Medium Priority
?
1,540 Views
Last Modified: 2013-12-26
The SNC does not have the PWdialog and I can't change the expired SQL Server
2005 expired password since I get a message transaction not connected.

What is the method to force the password change upon first login ?


0
Comment
Question by:Rich-Alaska
  • 5
  • 3
8 Comments
 
LVL 18

Expert Comment

by:diasroshan
ID: 23587814
Hi,

http://msdn.microsoft.com/en-us/library/ms131024.aspx
ODBC User Interface Password Expiration
The SQL Server Native Client ODBC driver supports password expiration through changes made to the SQL Server Login dialog boxes.

If SQLDriverConnect is called and the value of DriverCompletion is set to SQL_DRIVER_NOPROMPT, the initial connection attempt fails if the password has expired. The SQLSTATE value 28000 and the native error code value 18487 are returned by subsequent calls to SQLError or SQLGetDiagRec.

If DriverCompletion has been set to any other value, the user sees the SQL Server Login dialog, regardless of whether or not the password has expired. The user can click on the Options button and check Change Password to change the password.

If the user clicks OK and the password has expired, SQL Server prompts to enter and confirm a new password using the Change SQL Server Password dialog.

Cheers,
Rosh
0
 

Author Comment

by:Rich-Alaska
ID: 23590434
Sorry but I'm using the OLEDB version of SQL NATIVE CLIENT not the ODBC.

Will this work for OLEDB ?
0
 
LVL 18

Accepted Solution

by:
diasroshan earned 1000 total points
ID: 23597746
Hi,

It will work with OLEDB,

http://msdn.microsoft.com/en-us/library/ms131024.aspx
 SQL Server Native Client OLE DB Provider
The SQL Server Native Client OLE DB provider supports password expiration though a user interface and programmatically.

OLE DB User Interface Password Expiration
The SQL Server Native Client OLE DB provider supports password expiration through changes made to the SQL Server Login dialog boxes. If the value of DBPROP_INIT_PROMPT is set to DBPROMPT_NOPROMPT, the initial connection attempt will fail if the password has expired.

If DBPROP_INIT_PROMPT has been set to any other value, the user sees the SQL Server Login dialog, regardless of whether or not the password has expired. The user can click on the Options button and check Change Password to change the password.

If the user clicks OK and the password has expired, SQL Server prompts the user to enter and confirm a new password using the Change SQL Server Password dialog.

OLE DB Prompt Behavior and Locked Accounts
Connection attempts may fail due to the account being locked. If this occurs following the display of the SQL Server Login dialog, the server error message is displayed to the user and the connection attempt is aborted. It may also occur following the display of the Change SQL Server Password dialog if the user enters a bad value for the old password. In this case the same error message is displayed, and the connection attempt is aborted.

OLE DB Connection Pooling, Password Expiration, and Locked Accounts
An account may be locked or its password may expire while the connection is still active in a connection pool. The server checks for expired passwords and locked accounts on two occasions. The first is when a connection is first created. The second occasion is upon connection reset, when the connection is taken from the pool.

When the reset attempt fails, the connection is removed from the pool and an error is returned.

OLE DB Programmatic Password Expiration
The SQL Server Native Client OLE DB provider supports password expiration through the addition of the SSPROP_AUTH_OLD_PASSWORD (type VT_BSTR) property that has been added to the DBPROPSET_SQLSERVERDBINIT property set.

The existing "Password" property refers to DBPROP_AUTH_PASSWORD and is used to store the new password.

Cheers,
Rosh
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:Rich-Alaska
ID: 23600852
Can you show an actual example of the connection string. I have read the same documentation and cannot make it work.

I'm using Powerbuilder.

Thanks
0
 

Author Comment

by:Rich-Alaska
ID: 23615664
can I just get a simple example please.

I'm confused on the format of the connection string using these driver specific parameters

Thanks
0
 

Author Comment

by:Rich-Alaska
ID: 23750944
unfortunately the answer is no good without a example.
0
 
LVL 18

Expert Comment

by:diasroshan
ID: 23762629
Hi,

Unfortunately, i havent been able to get my hands on SQL Server to try and give u some example. U cud always give it a try urself and we can help u move ahead from there. But there needs to be a starting point.

Cheers,
Rosh
0
 

Author Comment

by:Rich-Alaska
ID: 23764393
I understand and appreciate any help if you get access. However, realize I had been trying to code this up for about a week before I posted.  

Thanks,
Richard
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question