- David Sowray
- PowerBuilder
- Monday, 28 February 2022 02:12 PM UTC
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
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.