cancel
Showing results for 
Search instead for 
Did you mean: 

ASE connectivity using sybase dblib

0 Kudos
409

Hi,

i am running a C++ application which connects to sybase 16 DB.

This application uses sybase DB LIB API call (like dblogin, dbopen etc).

Recently there is a password encryption enabled on this database which requires setting EncryptPassword=1 in connection string while connecting to database.

How this DB connection can be safely established from a C++ application using sybase DB lib.

Accepted Solutions (0)

Answers (2)

Answers (2)

Mark_A_Parsons
Contributor

Piyush,

NOTE: I don't work with dblib/ctlib so fwiw ...

You've stated ... "I tried setting DBSETLENCRYPT to true in connection request but it did not work".

Can you expand on what you mean by "it did not work"? did you receive an error and if so what was the complete error message? the program hangs? something else?

You may also want to provide a copy of your code snippets, with and without the DBSETLENCRYPT setting, in case someone (with dblib/ctlib experience) can spot a coding issue.

Also, when I run a search on DBSETLENCRYPT against that same document (see link in Chris Baker's post) I found this caveat to setting DBSETLENCRYPT in dblib:

Calling DBSETLENCRYPT causes an error unless you first set the DB-Library version to 10.0.
Use dbsetversion to set the DB-Library version to 10.0 before calling DBSETLENCRYPT.

Can you provide an update on whether or not you called dbsetversion (to set the dblib version to 10.0) and the result from said invocation?

Regards,

Mark

Hi Mark,

setting the dbsetversion to 10.0 has worked. Thanks for your reply ..

c_baker
Product and Topic Expert
Product and Topic Expert

There is documentation at: https://help.sap.com/docs/SAP_ASE_SDK/508bbd4903c74c50be8afcc0b92ebc9a/c016059d6db61014bf8f040071e61...

However, be aware that CTLIB should be used for all new application development - https://launchpad.support.sap.com/#/notes/3059630. DBLIB is very old and may be removed in future SDK releases.

Chris

0 Kudos

Hi Chris,

Thanks for your response.

This is the old application which is already using DBLIB and this application need to be migrated to sybase 16 encryption enabled server. It’s difficult for us to move the whole application on CTLIB.

I tried setting DBSETLENCRYPT to true in connection request but it did not work. Should we need to get the encryption key from server, encrypt the password and then send it ? Do you have any example as to how this can be done.

In CTLIB its a one liner change to support this enhancement. If I am not wrong just need to set CS_SEC_EXTENDED_ENCRYPTION.

Kindly provide detail example as to how to support this enhancement in DBLIB

c_baker
Product and Topic Expert
Product and Topic Expert
0 Kudos

I cannot provide examples beyond the documentation.

I am not a dblib/ctlib expert, so if the documented methods do not work, there may be others, like Mark, who can help.

In the end, however, you may have to look at converting the application code to CTLIB.

Chris