To connect to MSSQL 2022 on windows server

I can set the manager op with my user, but i need to tick the "“Trust server certificate”. To do the same from my program, I have tried:
TryConnect ROUTINE

GLO:DBOwner = CLIP(LOC:Server) & ‘,’ & CLIP(LOC:Database) & ‘,’ & |
CLIP(LOC:User) & ‘,’ & CLIP(LOC:Passw) & ‘;’ & |
‘Encrypt=Yes;TrustServerCertificate=Yes’

GLO:tmsowner = CLIP(LOC:server_TMS) & ‘,’ & CLIP(LOC:database_tms) & ‘,’ & |
CLIP(LOC:user_tms) & ‘,’ & CLIP(LOC:Passw_TMS) & ‘;’ & |
‘Encrypt=Yes;TrustServerCertificate=Yes’

SQLInterf{PROP:Owner} = GLO:DBOwner
SQLInterf{PROP:LogonScreen} = 0
RES# = SEND(SQLInterf,‘/Busyhandling = 2’)

OPEN(SQLInterf)

It opens in
SQL Server Management Studio 20.2.37.0
SQL Server Management Objects (SMO) 17.100.40.0

But i still get errors in SQL 2022.

What to do?

Best regards
Edvard Korsbæk

What SQL client is on the machine that’s trying to connect?

If I recall correctly, ODBC client 18 defaults to requiring the certificate and encryption.

You can create an ODBC Data Source Name (DSN) that doesn’t do encryption or that does trust the server and use the ODBC Clarion driver rather than the SQL driver.

The Clarion 12 dictionary has tantalizing checkboxes for trusting the server. But in my testing, they don’t work.

I reported this in PTSS 43463, which is languishing as Submitted (not even opened).

1 Like

Try
Encrypt=no
As a test

Dear Bruce!
THANKS!
And Jane, thanks for your reply too