Following The Good Samaritan Principle, here’s a tip for people using PowerBuilder against a SQL Server back end with single-sign-on.
If you want your PowerBuilder 8.5 application to use Windows Authentication with your SQL Server 2008 connection, here’s code that works:
/* Connect by authentication - Populate SQLCA */
SQLCA.DBMS = "MSS Microsoft SQL Server 2008"
SQLCA.ServerName = "MyServer"
SQLCA.Database = "MyDatabase"
// Do NOT! alter the order of these two DBParm statements!
SQLCA.DBParm = "TrustedConnection=1"
SQLCA.DBParm = "Secure=1"
CONNECT
This code was developed by a colleague and friend, Renwick Wright, after many hours of frustration. Blogged that others might find (courtesy of Professor Google or Doctor Bing) and be able to keep their hair.