0

I have a problem with program written in PowerBuilder. There is code:

DataStore ds_logged_get
ds_logged_get= CREATE DataStore
ds_logged_get.dataobject = 'dw_logged_get'
ds_logged_get.settransobject(sqlca)
ds_logged_get.Retrieve( pn_login, pn_domain, ls_ip_addr )
If ds_logged_get.RowCount() > 0 Then

Under datawindow is configure to execute procedure st_loggedGet

 procedure="1 execute dbo.st_loggedGet;1 @login = :login, @Domain = :Domain , @IP = :IP" arguments=(("login", string),("Domain ", string),("IP", string)) )

Unfortunately the line ds_logged_get.RowCount() is returning 0 records. When I run a procedure with the same parameters it returns appreciate record. What is more when I run datawindow for test it also returns record. There is no records only when i start program. I have even check by SQL Profiler and I have realised that procedure is not executed at all. When method Retrieve execute store procedure?

I have just started learning PowerBuilder. Could anyone help me? Thanks in advance. Piotr

Piotr
  • 569
  • 6
  • 20

2 Answers2

2

The settransobject method returns an integer. If it is a -1 there is something wrong with your transaction object (the global one called SQLCA). It could be something incorrect with your connection parameters. You can check the SQLCode when you connect with SQLCA to help determine what is wrong.

Matt Balent
  • 2,337
  • 2
  • 20
  • 23
  • `SetTransObject` may also return -1 if it there is something wrong with your DataWindow object `dw_logged_get`. – MicKr- Feb 09 '17 at 08:29
0

The problem was with the client to the database. In database profile in application PB I use Microsoft SQL Server Native Client 10.0, however on my computer where I run the app I use Microsoft SQL Server Native Client 11.0 (defined in ODBC Data Source Administrator). After change for the same client: Microsoft SQL Server Native Client 10.0 it starts perfectly.

Piotr
  • 569
  • 6
  • 20