Hi, any of you seen similar behavior where CONNECT using Windows authentication requires repeated CONNECT attempts?
What I have:
Setup :: PB 2017 R3, #1858 using ADO.NET with MSSQL.
Code :: See below
SQL Server Authentication :: (using LogId + LogPass) ==> Successful each time
Windows Authentication :: (using TrustedConnection=1) ==> Fails often, but repeating succeeds each time.
...
this.DBMS = 'ADO'
this.DBParm = "NameSpace='System.Data.SqlClient'"
this.DBParm += ",DataSource= ..."
...
this.DBParm += ",TrustedConnection=1"
this.LogId = ''
this.LogPass = ''
...
CONNECT USING this;
if this.SQLCode <> 0 then
...
Error info here is as follows:
this.SQLCode = -1
this.SQLDBCode = 999
this.SQLErrText = System.Exception: Failed to get current user name.
at Sybase.PowerBuilder.Db.Block.SqlBlock.Connect(Object[] input, Dbms& dbms, DBVersion& dbVer, String& user)
at Sybase.PowerBuilder.Db.DbRoutine.Connect(DbDrivers type, Object[] input, Dbms& dbms, DBVersion& dbVer, String& user)
It is the CONNECT statement itself that fails with this error message. No embedded SQL form the PowerBuilder app has executed yet.
First attempt at CONNECT using TrustedConnection has approx 50% success rate.
Second attempt has so far had a 100% success rate. We need first attempt to show same success rate.
Any suggestions greatly appreciated!
/Michael