1. Alan Trottier
  2. PowerBuilder
  3. Wednesday, 14 October 2020 10:40 AM UTC

Using PB 2017 R3 with Sybase 16 Database: Connecting to the databases works fine thru the Database administrator but when trying to run my .pbl I am unable to connect. Using the function "of_connect" in the object pfc_n_tr of the pfcmain.pbl returns a -1 (failure to connect). The question is how does the "connect using this;" statement work? How does it establish the connection to the database? It must follow a different path than the db administrator does since I can connect to the databases in that manner. I have tried uninstalling and re-installing PowerBuilder. Didn't help. By the way this was not a problem until recently. Always worked previously, then suddenly stopped. Holding up my development work. Not sure what to try next. Any and all help would be greatly appreciated.

Thank You,

Alan Trottier

 

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 14 October 2020 18:47 PM UTC
  2. PowerBuilder
  3. # 1

Hi Alan;

   FWIW: I use the <DB Command> Using THIS; all over my frameworks and this has not caused any issues from way back in decades old PB releases up to the current PB 2019 R3 beta. The Pronoun THIS is only used to resolve the TO instance that the DML command pertains to (AKA it's Handle). For example ...

  I even have my own version of an SQL SPY like feature (different implementation architecture though than the PFC). I have ASE 16 installed and test against that DB instance all the time with no such issue like yours ...

  Many of my Apps use SQLCA and many other PB Apps use their own Transaction Object instances (without SQLCA). So I can say that Global, Shared (yes, I even use shared objects with my TO's when multi-threading), Instance and Local TO's are all working well with ASE 16.x. All my PB Apps use my "of_connect" with the Using THIS extension - again, with no issues. Eeven in PB 2019 R3 beta and now even a PowerClient deployed App.  ;-)

  The problem might be with the settings in your TO(s). Here is an example of what I use in my ASE TO's settings ...

// Profile ASE 16 (Chris)
SQLCA.DBMS = "ASE"
SQLCA.Database = "Chris"
SQLCA.LogPass = <**********>
SQLCA.ServerName = "STDCHRIS"
SQLCA.LogId = "Chris"
SQLCA.AutoCommit = False
SQLCA.DBParm = "Release='16',Async=1,DBGetTime=5,DBTextLimit='90000',TrimSpaces=0,AppName='PB2019R2',Host='STD-Chris'"

  The only other thing that I can think of might be something in the PFC's support of TO's or SQLSpy that causes a "conflict" with newer ASE releases (just a guess).

HTH

Regards ... Chris

 

 

 

Comment
There are no comments made yet.
Alan Trottier Accepted Answer Pending Moderation
  1. Wednesday, 14 October 2020 12:06 PM UTC
  2. PowerBuilder
  3. # 2

For some reason if I have a connection to a database in the DB administrator I get the "Unable to Connect" error. If I ensure there are no connections during the attempt to run my .pbl then it works. I never had to do this previously. Why this has changed is the question, but regardless remove any connection and I am good to go.

Comment
  1. Olan Knight
  2. Thursday, 15 October 2020 01:07 AM UTC
This sounds like a database level limitation, like the max number of sessions or the max number of connections per user. See what your DBA says about these potential limits.
  1. Helpful
There are no comments made yet.
Alan Trottier Accepted Answer Pending Moderation
  1. Wednesday, 14 October 2020 11:27 AM UTC
  2. PowerBuilder
  3. # 3

Thanks for the quick response Roland. All properties are already set and present when the call to of_connect() is made. I'll run the debug again to make sure they are present. As stated earlier this always worked which makes this hard problem to trouble shoot. There were no changes made to my workspace in the time it went from working to not working.

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 14 October 2020 11:16 AM UTC
  2. PowerBuilder
  3. # 4

You have to set the connection properties in sqlca first.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.