We have an application we're trying to move from PB 2019 R2 Build 2353 to PB 2021 Build 1506. At the same time, we're also looking to distribute the application using PowerClient. The initial testing looks promising apart from not being able to connect to the SQL Server database using ADO.net on the test client machine.
To troubleshoot the problem, I've built a small test app, which just tests connecting to the database. The application is very simple and mainly consists of the following code:
SQLCA.DBMS = "ADO.Net"
SQLCA.LogId = "db_log_id_here"
SQLCA.LogPass = "password_here"
SQLCA.AutoCommit = true
SQLCA.DBParm = "Namespace='System.Data.SqlClient',DataSource='xxxxxxx.xxxxxxx.co.uk',Database='dbnamehere'"
connect using sqlca;
messagebox('Test PowerClient (Compiled ' + string(compiledate) + ' at ' + string(compiletime) + ')', 'SQLCA.SQLCode = ' + string(sqlca.sqlcode) + '~r~n' + sqlca.sqlerrtext)
Using PowerClient to distribute the app, the database connection fails, with the message that the PublicKeyToken was not found.
However the test app connects successfully on the client machine if I:
1) Build the application as a normal application and copy the exe and pbd file to a directory on the client machine
2) Add the Runtime\21.0.0.1506 files from the runtime directory created by PowerClient
3) Manually add a copy of Sybase.PowerBuilder.DataSource.Sharing.dll from the development machine
I therefore tried adding the Sybase.PowerBuilder.DataSource.Sharing.dll as an External File in the PowerClient project definition. When that didn't work, I tried manually adding the DLL directly to the PowerClient Runtime\21.0.0.1506 directory. Neither of these solutions work.
Is there a way to use PowerClient to distribute an application which uses an ADO.Net connection, or are we stuck using the traditional distribution methods?
Many thanks for any assistance,
David
- David Sowray
- PowerBuilder
- Monday, 28 February 2022 14:12 PM UTC
- Page :
- 1
There are no replies made for this question yet.
However, you are not allowed to reply to this question.
However, you are not allowed to reply to this question.
2) Note that the ""Sybase.PowerBuilder.XXXX.YYYY" DLLs typically also need to be registered to the O/S. That is what the "PB Packager" MSI utility does in it's deployment installation of the PB runtime.
- If I add this missing DLL to the traditionally built app, the app then works.
- If I add this missing DLL to the PowerClient distributed app, the app still doesn't work.
I have already tried adding this DLL on the External Files tab as well as adding it manually, but it doesn't fix the problem. As far as I can work out, the ADO.net connection doesn't work for PowerClient distributed apps. Are you saying there's another DLL I should be adding to the External Files tab to get it to work?