Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

Hello, all Is it possible that when specifying the Connection string through DSN and adding InitString property to it in code, then the InitString will be taken from the DSN?

We noticed that this DBPARM does not work (the InitString does not happen):

//----------------------

ConnectString='DSN=dsnName;InitString=....'

//--------------------------

If using execute immediate for the same string, the the connection authentication is visible in the connection property.

Thank you

Arcady

asked 22 Jul '19, 08:08

Arcady%20Abramov's gravatar image

Arcady Abramov
143151621
accept rate: 0%

edited 22 Jul '19, 08:13

Please show us all the code used to implement the PowerBuilder CONNECT.

Suggestion: If you are having problems using DSNs, the simple solution is to stop using DSNs. Here is a template...

SQLCA.DBMS = 'ODB'

SQLCA.DBParm &
    = "ConnectString='Driver=SQL Anywhere 11;" &
    + "UID=dba;PWD=sql;" &
    + "START=C:\Program Files\SQL Anywhere 11\bin32\dbeng11.exe;" &
    + "ASTOP=NO;" &
    + "DBF=C:\projects\$SA_templates\ddd11.db;" &
    + "ENG=ddd11;" &
    + "DBN=ddd11;'," &
    + "ConnectOption='SQL_DRIVER_CONNECT,SQL_DRIVER_NOPROMPT'"

CONNECT USING SQLCA;

IF SQLCA.SQLCODE <> 0 THEN
    MessageBox ( 'Error', &
        'CONNECT 1 failed in open:' &
        + '~r~nSQLCode = ' &
        + String ( SQLCA.SQLCode ) &
        + '~r~nSQLDBCode = ' &
        + String ( SQLCA.SQLDBCode ) &
        + '~r~n' &
        + SQLCA.SQLErrText )
    RETURN
END IF

MessageBox ( 'CONNECT 1', 'OK' );
(22 Jul '19, 09:15) Breck Carter

Hello, Breck WE are fully aware of the problems with DSN entires. However, it is not something which we can control at this time.

Actually, in PB, the problem is non-existent, since we use "EXECUTE IMMEDIATE" and not the InitString. Our problem is in other applications.

But now I believe it could be a simple QUOTE/APOS problem. I told the developers to take another look at the connection strings and how the quotes are placed. It could very well be as simple as that.

Thank you for your help

Arcady

permanent link

answered 22 Jul '19, 09:21

Arcady%20Abramov's gravatar image

Arcady Abramov
143151621
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×159

question asked: 22 Jul '19, 08:08

question was seen: 1,064 times

last updated: 22 Jul '19, 09:21