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.

Comments

blog comments powered by Disqus
Next Post
Announcing NAntGraph2  27 Mar 2010
Prior Post
Catching 'Exception' is Bad. Isn't It?  04 Mar 2010
Related Posts
Browsers and WSL  31 Mar 2024
Factory methods and functions  05 Mar 2023
Using Constructors  27 Feb 2023
An Inconvenient API  18 Feb 2023
Method Archetypes  11 Sep 2022
A bash puzzle, solved  02 Jul 2022
A bash puzzle  25 Jun 2022
Improve your troubleshooting by aggregating errors  11 Jun 2022
Improve your troubleshooting by wrapping errors  28 May 2022
Keep your promises  14 May 2022
Archives
March 2010
2010