1. backya arun
  2. PowerBuilder
  3. Thursday, 19 March 2020 07:59 AM UTC

Hi

We have migrated PB 8 to 11.5 and then PB 11.5 to PB 19 version. i'm using ADO.Net DBMS.While clicking OK button in application Global function is called and one insert statement and then commit  statement inside IF block is executed successfully.after that in else statement the application is hanged. Even i have tried commenting the commit and else statement.. it doesn't work out..while running in event viewer i'm getting this error..Can you pls help me regarding this??

Accepted Answer
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Saturday, 21 March 2020 09:55 AM UTC
  2. PowerBuilder
  3. # Permalink

Thank you Arun,

I've looked at the code you posted:

If I understood well, debug goes into the first IF, does a "GetUserNameA()" and at the end of the code does a COMMIT and then hangs. (while there's no more code after that last IF ELSE ENDIF).

The only thing I'd worry about is the GetUserNameA() call. It passes ls_loginID, but without initializing ls_loginID. The API function GetUserNameA() needs a parameter "by ref" for the username, so that means it has to be initialized in PB. The second parameter is also by ref but that's a non-string parameter, so by having a value assigned to it, it's already initialized.

Try initializing ls_loginID at the beginning of the code (before doing any calls to GetUserName like this:

ls_loginID = Space(255)

Also:

You migrated from PB non-unicode 8.x to 11.x and then 2019. All pb versions, beginning with v. 10.x are Unicode, so that means the external API function declaration should preferrably be the Unicode versions (with "W" instead of "A"). The migration process should have added ";Ansi" to your GetUserNameA() function declaration, but ... :

Instead of using GetUsernameA(), use GetUsernameW():

function boolean GetUserNameW(ref string  lpBuffer, ref ulong nSize) library "ADVAPI32.DLL"

See if that helps.

Regards.

MiguelL

----

 Here it the code posted, but with indentation:

STRING ls_Access_Profile,ls_system_ip,ls_Access_Name,ls_host,ls_error
STRING ls_Audit_Name,ls_userName,ls_groupid,ls_GroupName,ls_createdby,ls_windowsUserid
Blob{4} lb_host
Integer li_version,li_Count
string ls_loginid,ls_Access_ID,ls_Audit_ID
ulong lul_value
boolean lb_rc

str_ws2 lstr_wsadata

IF as_option = 'Login' THEN

	ls_host = Space(128)
	li_version = 257

	GetHost(g_computername, lb_host)

	/*ls_system_ip = String(Asc(String(BlobMid(lb_host, 1, 1)))) + "."
	ls_system_ip += String(Asc(String(BlobMid(lb_host, 2, 1)))) + "."
	ls_system_ip += String(Asc(String(BlobMid(lb_host, 3, 1)))) + "."
	ls_system_ip += String(Asc(String(BlobMid(lb_host, 4, 1))))*/
	//Commented and added by Backya-20.03.2020-Migartion changes-start
	ls_system_ip = String(Asc(String(BlobMid(lb_host, 1, 1),EncodingANSI!))) + "."
	ls_system_ip += String(Asc(String(BlobMid(lb_host, 2, 1),EncodingANSI!))) + "."
	ls_system_ip += String(Asc(String(BlobMid(lb_host, 3, 1),EncodingANSI!))) + "."
	ls_system_ip += String(Asc(String(BlobMid(lb_host, 4, 1),EncodingANSI!)))
	//Backya-20.03.2020-Migartion changes-start

	SELECT levelname INTO :ls_Access_Profile
	FROM ent_userlevels with (nolock)
	WHERE levelid = :g_suserlevel USING SQLCA;

	IF sqlca.sqlcode <> 0 THEN
		ls_error = sqlca.sqlerrtext
		Messagebox("Login - SplunkData(ent_userlevels)",ls_error)
	END IF

	SELECT username INTO :ls_Access_Name
	FROM ent_users with (nolock)
	WHERE userid = :g_sUser USING SQLCA;

	IF sqlca.sqlcode <> 0 THEN
		ls_error = sqlca.sqlerrtext
		Messagebox("Login - SplunkData(ent_users)",ls_error)
	END IF

	lul_value = 255
	lb_rc = GetUserNameA( ls_loginid, lul_value )
	ls_Access_ID = g_sUser + "_" + ls_loginid

	INSERT INTO Ent_ICCS_Splunk_LoginData
	(Businessdate,Splunk_RefNumber,Access_ID,Access_Name,Access_Profile,Access_Type,
	Access_Country,Access_SourceIP,Access_SourceHost,Access_LoginTimeStamp,Login_Export
	)
	VALUES
	(:businessdate,:gs_splunk_refnbr,:ls_Access_ID,:ls_Access_Name,:ls_Access_Profile,'Desktop',
	'AE',:ls_system_ip,:g_computername,getdate(),'N'
	) USING SQLCA;

ELSEIF as_option = 'Logout' THEN

	lul_value = 255
	lb_rc = GetUserNameA( ls_loginid, lul_value )
	ls_Access_ID = g_sUser + "_" + ls_loginid

	UPDATE Ent_ICCS_Splunk_LoginData SET Access_LogoutTimeStamp = getdate(),Login_Export = 'N'
	WHERE Access_ID = :ls_Access_ID
	AND Splunk_RefNumber = :gs_splunk_refnbr USING SQLCA;

	IF sqlca.sqlcode = 0 THEN
		COMMIT USING SQLCA;
	ELSE
		ls_error = sqlca.sqlerrtext
		Messagebox("Logout - SplunkData(ent_users)",ls_error)
	END IF

	/*
	SELECT Count(1) INTO :li_Count
	FROM Ent_ICCS_Splunk_LoginData with(nolock)
	WHERE Access_ID = :g_sUser
	AND Splunk_RefNumber = :gs_splunk_refnbr
	AND isnull(Login_Export,'N') = 'N'
	USING SQLCA;

	IF li_Count > 0 THEN

		UPDATE Ent_ICCS_Splunk_LoginData SET Access_LogoutTimeStamp = getdate()
		WHERE Access_ID = :g_sUser
		AND Splunk_RefNumber = :gs_splunk_refnbr USING SQLCA;

		IF sqlca.sqlcode = 0 THEN
			COMMIT USING SQLCA;
		ELSE
			ls_error = sqlca.sqlerrtext
			Messagebox("Logout - SplunkData(ent_users)",ls_error)
		END IF
	ELSE
		INSERT INTO Ent_ICCS_Splunk_LoginData
		(Businessdate,Splunk_RefNumber,Access_ID,Access_Name,Access_Profile,Access_Type,
		Access_Country,Access_SourceIP,Access_SourceHost,Access_LoginTimeStamp,Access_LogoutTimeStamp,Login_Export
		)
		SELECT Businessdate,Splunk_RefNumber,Access_ID,Access_Name,Access_Profile,Access_Type,
		Access_Country,Access_SourceIP,Access_SourceHost,Access_LoginTimeStamp,getdate(),'N'
		FROM Ent_ICCS_Splunk_LoginData with(nolock)
		WHERE Access_ID = :g_sUser
		AND Splunk_RefNumber = :gs_splunk_refnbr
		AND isnull(Login_Export,'N') = 'Y'
		USING SQLCA;
	END IF
	*/
ELSEIF as_option = 'Audit_History' THEN

	ls_host = Space(128)
	li_version = 257


	GetHost(g_computername, lb_host)

	/*ls_system_ip = String(Asc(String(BlobMid(lb_host, 1, 1)))) + "."
	ls_system_ip += String(Asc(String(BlobMid(lb_host, 2, 1)))) + "."
	ls_system_ip += String(Asc(String(BlobMid(lb_host, 3, 1)))) + "."
	ls_system_ip += String(Asc(String(BlobMid(lb_host, 4, 1))))*/
	//Added by Backya-20.03.2020-Migartion changes-start
	ls_system_ip = String(Asc(String(BlobMid(lb_host, 1, 1),EncodingANSI!))) + "."
	ls_system_ip += String(Asc(String(BlobMid(lb_host, 2, 1),EncodingANSI!))) + "."
	ls_system_ip += String(Asc(String(BlobMid(lb_host, 3, 1),EncodingANSI!))) + "."
	ls_system_ip += String(Asc(String(BlobMid(lb_host, 4, 1),EncodingANSI!)))
	//Added by Backya-20.03.2020-Migartion changes-end

	SELECT username INTO :ls_Audit_Name
	FROM ent_users with (nolock)
	WHERE userid = :g_sUser USING SQLCA;

	IF sqlca.sqlcode <> 0 THEN
		ls_error = sqlca.sqlerrtext
		Messagebox("Audit_History - SplunkData(ent_users)",ls_error)
	END IF

	lul_value = 255
	lb_rc = GetUserNameA( ls_loginid, lul_value )
	ls_Audit_ID = g_sUser + "_" + ls_loginid

	INSERT INTO Ent_ICCS_Splunk_Audit_HistoryData
	(Businessdate,Splunk_RefNumber,Audit_ID,Audit_Name,Audit_Status,Access_SourceIP,
	Access_SourceHost,Audit_Country,Audit_LoginTimeStamp,Audit_Status_Export
	)
	VALUES
	(:businessdate,:gs_splunk_refnbr,:ls_Audit_ID,:ls_Audit_Name,:as_loginstatus,:ls_system_ip,
	:g_computername,'AE',getdate(),'N'
	) USING SQLCA;


ELSEIF as_option = 'ID_Management' THEN

	//RegistryGet("HKEY_LOCAL_MACHINE\SOFTWARE\ACCS\","LoginId",RegString!,ls_loginid)

	SELECT username,levelid,CASE WHEN :as_idmanagement_status = 'Create' THEN CreatedBy ELSE LastModifiedBy END,CreatedUser_WUserID
	INTO :ls_userName,:ls_groupid,:ls_createdby,:ls_windowsUserid
	FROM ent_users with(nolock)
	WHERE userid = :as_idmanagement_userid USING SQLCA;

	IF sqlca.sqlcode <> 0 THEN
		ls_error = sqlca.sqlerrtext
		Messagebox("ID_Management - SplunkData(ent_users)",ls_error)
	END IF

	ls_createdby = ls_createdby + "_" + ls_windowsUserid

	SELECT levelname INTO :ls_GroupName
	FROM ent_userlevels with (nolock)
	WHERE levelid = :ls_groupid USING SQLCA;

	IF sqlca.sqlcode <> 0 THEN
		ls_error = sqlca.sqlerrtext
		Messagebox("ID_Management - SplunkData(ent_userlevels)",ls_error)
	END IF

	INSERT INTO Ent_ICCS_Splunk_ID_Management
	(Businessdate,Splunk_RefNumber,AppID_ID,AppID_Profile,AppID_Name,AppID_Type,AppID_Implemented_By,
	AppID_Implemented_TimeStamp,AppID_Group,AppID_Status,AppID_Country,ID_Management_Export
	)
	VALUES
	(:businessdate,:gs_splunk_refnbr,:as_idmanagement_userid,:ls_groupid,:ls_GroupName,'',:ls_createdby,
	getdate(),'',:as_idmanagement_status,'AE','N'
	) USING SQLCA;
ELSEIF as_option = 'Profile_Management' THEN

	SELECT levelname,CASE WHEN :as_idmanagement_status = 'Create' THEN createdby ELSE ModifiedBy END,Windows_UserID
	INTO :ls_groupName,:ls_createdby,:ls_windowsUserid
	FROM ent_userlevels WITH(NOLOCK)
	WHERE levelid = :as_idmanagement_userid USING SQLCA;

	IF sqlca.sqlcode <> 0 THEN
		ls_error = sqlca.sqlerrtext
		Messagebox("Profile_Management - SplunkData(ent_userlevels)",ls_error)
	END IF

	ls_createdby = ls_createdby + "_" + ls_windowsUserid

	INSERT INTO Ent_ICCS_Splunk_Profile_Management
	(Businessdate,Splunk_RefNumber,Group_ID,Group_Name,Group_Type,
	Group_Implemented_By,Group_Implemented_TimeStamp,Group_Status,
	Group_Country,Profile_Management_Export
	)
	VALUES
	(:businessdate,:gs_splunk_refnbr,:as_idmanagement_userid,:ls_groupName,'',
	:ls_createdby,getdate(),:as_idmanagement_status,
	'AE','N'
	) USING SQLCA;

END IF

IF sqlca.sqlcode = 0 THEN
	COMMIT USING SQLCA;
ELSE
	ls_error = sqlca.sqlerrtext
	ROLLBACK USING SQLCA;
	Messagebox(as_option + ': SplunkData Error',ls_error)
END IF

 

 

Comment
  1. Miguel Leeuwe
  2. Sunday, 22 March 2020 17:16 PM UTC
Maybe it's a good idea to post your latest doubts as a new question, so it'll more likely anyone would try answer the new questions.

Kind regards,

MiguelL
  1. Helpful
  1. backya arun
  2. Tuesday, 24 March 2020 06:34 AM UTC
Hi Miguel,

Its okay no issue... i have changed my interface from ADO>net to SQL native client it is solved..Thank you!



Regards

Backya
  1. Helpful
  1. Miguel Leeuwe
  2. Tuesday, 24 March 2020 08:09 AM UTC
Yes, I think that's a way better option. Glad you solved things.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 20 March 2020 15:12 PM UTC
  2. PowerBuilder
  3. # 1

Just curiosity.

Could you post some code, at least your INSERT statement and after that your IF ELSE statement?

Maybe it'll give anyone a "hunch"

Regards,

MiguelL

Comment
  1. Miguel Leeuwe
  2. Friday, 20 March 2020 15:20 PM UTC
Miguel Leeuwe

Also, what is the code right AFTER your ELSE ... ENDIF?
  1. Helpful
  1. backya arun
  2. Saturday, 21 March 2020 06:44 AM UTC
Hi Miguell,

It goes inside 'login' as_option and insert statement is executed successfully.after it comes out, got committed and in that application gets hanged..

Below is the script.....



STRING ls_Access_Profile,ls_system_ip,ls_Access_Name,ls_host,ls_error

STRING ls_Audit_Name,ls_userName,ls_groupid,ls_GroupName,ls_createdby,ls_windowsUserid

Blob{4} lb_host

Integer li_version,li_Count

string ls_loginid,ls_Access_ID,ls_Audit_ID

ulong lul_value

boolean lb_rc



str_ws2 lstr_wsadata



IF as_option = 'Login' THEN



ls_host = Space(128)

li_version = 257



GetHost(g_computername, lb_host)



/*ls_system_ip = String(Asc(String(BlobMid(lb_host, 1, 1)))) + "."

ls_system_ip += String(Asc(String(BlobMid(lb_host, 2, 1)))) + "."

ls_system_ip += String(Asc(String(BlobMid(lb_host, 3, 1)))) + "."

ls_system_ip += String(Asc(String(BlobMid(lb_host, 4, 1))))*/

//Commented and added by Backya-20.03.2020-Migartion changes-start

ls_system_ip = String(Asc(String(BlobMid(lb_host, 1, 1),EncodingANSI!))) + "."

ls_system_ip += String(Asc(String(BlobMid(lb_host, 2, 1),EncodingANSI!))) + "."

ls_system_ip += String(Asc(String(BlobMid(lb_host, 3, 1),EncodingANSI!))) + "."

ls_system_ip += String(Asc(String(BlobMid(lb_host, 4, 1),EncodingANSI!)))

//Backya-20.03.2020-Migartion changes-start





SELECT levelname INTO :ls_Access_Profile

FROM ent_userlevels with (nolock)

WHERE levelid = :g_suserlevel USING SQLCA;



IF sqlca.sqlcode <> 0 THEN

ls_error = sqlca.sqlerrtext

Messagebox("Login - SplunkData(ent_userlevels)",ls_error)

END IF



SELECT username INTO :ls_Access_Name

FROM ent_users with (nolock)

WHERE userid = :g_sUser USING SQLCA;



IF sqlca.sqlcode <> 0 THEN

ls_error = sqlca.sqlerrtext

Messagebox("Login - SplunkData(ent_users)",ls_error)

END IF



lul_value = 255

lb_rc = GetUserNameA( ls_loginid, lul_value )

ls_Access_ID = g_sUser + "_" + ls_loginid



INSERT INTO Ent_ICCS_Splunk_LoginData

(Businessdate,Splunk_RefNumber,Access_ID,Access_Name,Access_Profile,Access_Type,

Access_Country,Access_SourceIP,Access_SourceHost,Access_LoginTimeStamp,Login_Export

)

VALUES

(:businessdate,:gs_splunk_refnbr,:ls_Access_ID,:ls_Access_Name,:ls_Access_Profile,'Desktop',

'AE',:ls_system_ip,:g_computername,getdate(),'N'

) USING SQLCA;





ELSEIF as_option = 'Logout' THEN



lul_value = 255

lb_rc = GetUserNameA( ls_loginid, lul_value )

ls_Access_ID = g_sUser + "_" + ls_loginid



UPDATE Ent_ICCS_Splunk_LoginData SET Access_LogoutTimeStamp = getdate(),Login_Export = 'N'

WHERE Access_ID = :ls_Access_ID

AND Splunk_RefNumber = :gs_splunk_refnbr USING SQLCA;



IF sqlca.sqlcode = 0 THEN

COMMIT USING SQLCA;

ELSE

ls_error = sqlca.sqlerrtext

Messagebox("Logout - SplunkData(ent_users)",ls_error)

END IF



/*

SELECT Count(1) INTO :li_Count

FROM Ent_ICCS_Splunk_LoginData with(nolock)

WHERE Access_ID = :g_sUser

AND Splunk_RefNumber = :gs_splunk_refnbr

AND isnull(Login_Export,'N') = 'N'

USING SQLCA;



IF li_Count > 0 THEN



UPDATE Ent_ICCS_Splunk_LoginData SET Access_LogoutTimeStamp = getdate()

WHERE Access_ID = :g_sUser

AND Splunk_RefNumber = :gs_splunk_refnbr USING SQLCA;



IF sqlca.sqlcode = 0 THEN

COMMIT USING SQLCA;

ELSE

ls_error = sqlca.sqlerrtext

Messagebox("Logout - SplunkData(ent_users)",ls_error)

END IF



ELSE

INSERT INTO Ent_ICCS_Splunk_LoginData

(Businessdate,Splunk_RefNumber,Access_ID,Access_Name,Access_Profile,Access_Type,

Access_Country,Access_SourceIP,Access_SourceHost,Access_LoginTimeStamp,Access_LogoutTimeStamp,Login_Export

)

SELECT Businessdate,Splunk_RefNumber,Access_ID,Access_Name,Access_Profile,Access_Type,

Access_Country,Access_SourceIP,Access_SourceHost,Access_LoginTimeStamp,getdate(),'N'

FROM Ent_ICCS_Splunk_LoginData with(nolock)

WHERE Access_ID = :g_sUser

AND Splunk_RefNumber = :gs_splunk_refnbr

AND isnull(Login_Export,'N') = 'Y'

USING SQLCA;

END IF

*/

ELSEIF as_option = 'Audit_History' THEN



ls_host = Space(128)

li_version = 257





GetHost(g_computername, lb_host)



/*ls_system_ip = String(Asc(String(BlobMid(lb_host, 1, 1)))) + "."

ls_system_ip += String(Asc(String(BlobMid(lb_host, 2, 1)))) + "."

ls_system_ip += String(Asc(String(BlobMid(lb_host, 3, 1)))) + "."

ls_system_ip += String(Asc(String(BlobMid(lb_host, 4, 1))))*/

//Added by Backya-20.03.2020-Migartion changes-start

ls_system_ip = String(Asc(String(BlobMid(lb_host, 1, 1),EncodingANSI!))) + "."

ls_system_ip += String(Asc(String(BlobMid(lb_host, 2, 1),EncodingANSI!))) + "."

ls_system_ip += String(Asc(String(BlobMid(lb_host, 3, 1),EncodingANSI!))) + "."

ls_system_ip += String(Asc(String(BlobMid(lb_host, 4, 1),EncodingANSI!)))

//Added by Backya-20.03.2020-Migartion changes-end



SELECT username INTO :ls_Audit_Name

FROM ent_users with (nolock)

WHERE userid = :g_sUser USING SQLCA;



IF sqlca.sqlcode <> 0 THEN

ls_error = sqlca.sqlerrtext

Messagebox("Audit_History - SplunkData(ent_users)",ls_error)

END IF



lul_value = 255

lb_rc = GetUserNameA( ls_loginid, lul_value )

ls_Audit_ID = g_sUser + "_" + ls_loginid



INSERT INTO Ent_ICCS_Splunk_Audit_HistoryData

(Businessdate,Splunk_RefNumber,Audit_ID,Audit_Name,Audit_Status,Access_SourceIP,

Access_SourceHost,Audit_Country,Audit_LoginTimeStamp,Audit_Status_Export

)

VALUES

(:businessdate,:gs_splunk_refnbr,:ls_Audit_ID,:ls_Audit_Name,:as_loginstatus,:ls_system_ip,

:g_computername,'AE',getdate(),'N'

) USING SQLCA;





ELSEIF as_option = 'ID_Management' THEN



//RegistryGet("HKEY_LOCAL_MACHINE\SOFTWARE\ACCS\","LoginId",RegString!,ls_loginid)



SELECT username,levelid,CASE WHEN :as_idmanagement_status = 'Create' THEN CreatedBy ELSE LastModifiedBy END,CreatedUser_WUserID

INTO :ls_userName,:ls_groupid,:ls_createdby,:ls_windowsUserid

FROM ent_users with(nolock)

WHERE userid = :as_idmanagement_userid USING SQLCA;



IF sqlca.sqlcode <> 0 THEN

ls_error = sqlca.sqlerrtext

Messagebox("ID_Management - SplunkData(ent_users)",ls_error)

END IF



ls_createdby = ls_createdby + "_" + ls_windowsUserid



SELECT levelname INTO :ls_GroupName

FROM ent_userlevels with (nolock)

WHERE levelid = :ls_groupid USING SQLCA;



IF sqlca.sqlcode <> 0 THEN

ls_error = sqlca.sqlerrtext

Messagebox("ID_Management - SplunkData(ent_userlevels)",ls_error)

END IF



INSERT INTO Ent_ICCS_Splunk_ID_Management

(Businessdate,Splunk_RefNumber,AppID_ID,AppID_Profile,AppID_Name,AppID_Type,AppID_Implemented_By,

AppID_Implemented_TimeStamp,AppID_Group,AppID_Status,AppID_Country,ID_Management_Export

)

VALUES

(:businessdate,:gs_splunk_refnbr,:as_idmanagement_userid,:ls_groupid,:ls_GroupName,'',:ls_createdby,

getdate(),'',:as_idmanagement_status,'AE','N'

) USING SQLCA;

ELSEIF as_option = 'Profile_Management' THEN



SELECT levelname,CASE WHEN :as_idmanagement_status = 'Create' THEN createdby ELSE ModifiedBy END,Windows_UserID

INTO :ls_groupName,:ls_createdby,:ls_windowsUserid

FROM ent_userlevels WITH(NOLOCK)

WHERE levelid = :as_idmanagement_userid USING SQLCA;



IF sqlca.sqlcode <> 0 THEN

ls_error = sqlca.sqlerrtext

Messagebox("Profile_Management - SplunkData(ent_userlevels)",ls_error)

END IF



ls_createdby = ls_createdby + "_" + ls_windowsUserid



INSERT INTO Ent_ICCS_Splunk_Profile_Management

(Businessdate,Splunk_RefNumber,Group_ID,Group_Name,Group_Type,

Group_Implemented_By,Group_Implemented_TimeStamp,Group_Status,

Group_Country,Profile_Management_Export

)

VALUES

(:businessdate,:gs_splunk_refnbr,:as_idmanagement_userid,:ls_groupName,'',

:ls_createdby,getdate(),:as_idmanagement_status,

'AE','N'

) USING SQLCA;



END IF



IF sqlca.sqlcode = 0 THEN

COMMIT USING SQLCA;

ELSE

ls_error = sqlca.sqlerrtext

ROLLBACK USING SQLCA;

Messagebox(as_option + ': SplunkData Error',ls_error)

END IF
  1. Helpful
  1. Miguel Leeuwe
  2. Saturday, 21 March 2020 09:39 AM UTC
Thank you, please see my next reply.
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Friday, 20 March 2020 14:00 PM UTC
  2. PowerBuilder
  3. # 2

As strongly as you would like to have a quick fix for this issue, please realize that there may not be one. If there was, it is likely that someone would have already offered it - I think the Appeon Community is terrific in that regard.

If I were in your shoes, I would create a new, VERY simple, babe-bones, single-window test application in PB 2019 that establishes a database connection using the same connection properties. If that app fails, you then have a small test case that you can post here and/or submit to Appeon Support to analyze. If it works, then step-by-step, build out the connection logic until it performs the same initialization steps as your failing application.

If that works, then I would probably use that new, working test app and slowly start adding functionality and windows to where it mimics the look and feel of the failing app.

I hope that other members of the community will chime in with additional ideas and alternative suggestions for you to consider.

Comment
  1. Armeen Mazda @Appeon
  2. Friday, 20 March 2020 15:12 PM UTC
Great perspectives and advice John!
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 19 March 2020 18:24 PM UTC
  2. PowerBuilder
  3. # 3

Greetings, Backya - 

What SQLCA.DBMS does your PB 8 version of your application use? MSS?

Is there a reason why you are migrating to the ADO.Net driver? Have you tried using the SNC (SQL Server Native Client) driver? When we migrated our app from PB 9 to 12.5 (and later to Appeon PB), we switched to the SNC driver and experienced no issues.

Regards, John

Comment
  1. backya arun
  2. Friday, 20 March 2020 06:09 AM UTC
Hi John,

In PB 8 version SQLCA.DBMS="MSS Microsoft SQL Server 6.x".. I have tried with SNC driver in that also application gets hanged.. No particular reason on using ADO.Net.. can you pls tell me the quick fix for this??



Regards,

Backya



  1. Helpful
There are no comments made yet.
backya arun Accepted Answer Pending Moderation
  1. Thursday, 19 March 2020 17:42 PM UTC
  2. PowerBuilder
  3. # 4

Hi Chris,

     Please find the answer for your queries.

1) PB2019 build number->Dont know exactly.. tmrw i will update you..

2) DBMS vendor being used->SQL server

3) DBMS version & build->sqlserver 2012

4) O/S's being used for DBMS and PB IDE / Apps-> Win 2010

5) Issue happens when run from the IDE, EXE or both?->Both

6) Is the "IF" you are referring to in PB or SQL?->In PB i have put if condition

7) How is your PB 11.5 Apps connecting to the DBMS? ->through ADO.net interface

8) Is the DBMS the same instance for PB 11.5 and 2019? ->Same DBMS.. It is working fine in PB 8 version..Not working in Both 11.5 and 19 versions.'

 

Regards,

Backya

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 19 March 2020 18:15 PM UTC
Hi Backya;

Thank you for that updated information to my questions! Based on Q#8 and your answer ... the problem "might" be related to ANSI vs Unicode. As PB 8 was ANSI based and PB 11.x and 2017/2019 are Unicode based versions of PB.



FWIW: Here are the parameters that I use in my PB2019 to SS2019 via ADO.Net.

SQLCA.DBMS = "ADO"

SQLCA.LogPass = <*****>

SQLCA.LogId = "Chris"

SQLCA.AutoCommit = False

SQLCA.DBParm = "Namespace='System.Data.SqlClient',Database='Chris',DataSource='STD-CHRIS\SQLEXPRESS',TimeOut=5000,BindSPInput=1,DelimitIdentifier='Yes',TrimSpaces=1"



HTH - Regards ... Chris
  1. Helpful
  1. backya arun
  2. Friday, 20 March 2020 05:48 AM UTC
Hi Chris,

I have tried setting DBParm like yours..But it doesn't workout. Also My PB19 is build 2170.



SQLCA.DBParm = "Namespace='System.Data.SqlClient',DataSource='"+SQLCA.ServerName+"',Database='"

+SQLCA.Database+"',Date=' \''yyyy-mm-dd\'' ' ,PBMaxBlobSize=200000,Secure='Yes',OptSelectBlob=1,

TimeOut=5000,BindSPInput=1,DelimitIdentifier='Yes',TrimSpaces=1'"..



Regards,

Backya

  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 20 March 2020 14:16 PM UTC
Hi Backya ... yes, I am on PB2019 build 2170 as well. No problems like this on my systems but, I mostly use the SNC SS driver.

My suggestion now is to open a Support Ticket for this issue as you also stated that the SNC driver causes a crash as well.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 19 March 2020 16:27 PM UTC
  2. PowerBuilder
  3. # 5

Hi Backya;

   You have not given us much to go on here in order to advise you further on this issue. BTW: ADO.Net is not a DBMS - its only one type of client connectivity mechanism to many DBMS vendors.

   Can you tell us ...

1) PB2019 build number

2) DBMS vendor being used

3) DBMS version & build

4) O/S's being used for DBMS and PB IDE / Apps

5) Issue happens when run from the IDE, EXE or both?

6) Is the "IF" you are referring to in PB or SQL?

7) How is your PB 11.5 Apps connecting to the DBMS?

8) Is the DBMS the same instance for PB 11.5 and 2019?

etc

Regards ... Chris

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.