I am using the configuration below to connect to the database using the ADO.NET provider, and it connects successfully.
// Profile ADOTest
SQLCA.DBMS = "ADO.Net"
SQLCA.LogPass = <**************>
SQLCA.LogId = "***"
SQLCA.AutoCommit = False
SQLCA.DBParm = "Provider='SQL Server',DataSource='SQL Server 2022',Database='ADO_Database'"
But when we called SQLCA.sqlnrows from the GetSQLCACode method, it returned zero. So, we can't implement the CURSOR in our application with the ADO.NET provider.
------------------------------------------
GetSQLCACode (){
i_code = SQLCA.sqlnrows
}
------------------------
DECLARE list CURSOR FOR
SELECT id
FROM sampletable
order by id;
ll_count = 0
Open list ;
DO WHILE TRUE
FETCH list INTO :ll_entity_id;
IF access.GetSQLCACode (SQLCA) > 0 THEN EXIT
ll_count ++
l_pbd_entity_id[ ll_count ] = ll_entity_id
Loop
Close list ;
Can you please let us know how to check SQLCA.sqlnrows and which parameters need to be provided for the ADO.NET provider?
What version of powerbuilder are you using?
Andreas.
This access object's connection details work fine in other places, such as select statements and database connections. We are facing an issue when we call SQLCA.sqlnrows.
The reason for ADO.NET is that we also have C# code, which is already using ADO.NET.
And the version of PowerBuilder is PowerBuilder 2022 R3 (IDE & Runtime version is Version 2022 R3 Build 3391)
Sorry I cannot answer your specific question, and that it's not what you want to here. Changing course now may well save you a lot of heartache later.